memory leak
please see the below picture
if move config code to another single code file, not in main entrypoint file, memory not leak any more.
Could you share your config?
Could you share your config?
yes, it absolutely!
port = 8741
threads = 4
workers = 2
max_clients = 100_000
max_body = 104857600
hm, I'm just thinking how I could reproduce it. Any chance you can share some code that leads to that error?
I think I'm seeing the same thing if I just add std.debug.print("leaks: {}\n", .{gpa.detectLeaks()}); to the bottom of example1.zig.
@bsl that's helpful, thanks! I can reproduce. I'll look into.
I think I'm seeing the same thing if I just add
std.debug.print("leaks: {}\n", .{gpa.detectLeaks()});to the bottom ofexample1.zig.
@bsl what I missed is that there are two defer statements in example.zig that free the memory. So std.debug.print("leaks: {}\n", .{gpa.detectLeaks()}); will definitely show some leaks because the memory hasn't been freed yet. There are no leaks if you explicitly call those deinit functions before the leak detection.
The error messages are exactly the same as @sunvim reported. I guess @sunvim had a similar setup.
I'm going to close this issue until we have further insights.
I'm sorry, I forgot that I needed to put the code under test in a block so the defers can actually happen. Thank you.