Quote:
Originally Posted by just_grindin
I am sort of confused how something is being freed but you're winding up crashing the server eventually. Maybe I am not understanding well enough.
I mean I can understand how memory is not being freed properly but without garbage collection wouldn't the memory be orphaned indefinitely? Is your program running on an OS that might perform that garbage collection?
The only memory I can think of that would be freed automatically is memory allocated on the stack when a function leaves scope. I am no expert though just really curious now haha.
I have a server process, and a client process. The client request to connect to the server and gets a pointer back that’s supposed to be like a file descriptor to the server.
As the client I will close this handle with our software API. Client side it seems like all memories being freed properly, but somewhere in the server process, the server is holding onto some memory from this operation, because memory usage slowly creeps up until a crash.
Eventually, if you spam open/close API from the client side youll crash something. But if the server exits normally, it properly frees up whatever has been hogging memory, and valgrind reports no leaks.
Am i explaining it right? Sorry, i am not good at this stuff