Cuberite Forum
Memory leak - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Memory leak (/thread-2234.html)



Memory leak - DrMasik - 12-05-2015

My system works some days and I see memory leak. How can I help to debug it is?
   


RE: Memmory leak - xoft - 12-08-2015

I'm not sure if it's a hard memory leak. I tried running Cuberite with valgrind for some time and after stopping, all the memory was properly freed.

It could still be a soft leak - the server knows about all the memory it allocated, but keeps allocating more and more.

I have no idea if there are any tools for Linux / BSD that could do live memory analysis. We're using a StackWalker for Windows builds that can keep track of each memory block's stacktrace at the time of allocation, so we could do some statistics on that (the dumpmem console command). This slows down everything so much that it's disabled by default and you'd need to set some preprocessor defines in order to enable it.


RE: Memory leak - worktycho - 12-13-2015

Valgrind is the tool on linux. Massif should be able to dump that info http://valgrind.org/docs/manual/ms-manual.html


RE: Memory leak - xoft - 12-17-2015

I'm still not able to use Massif effectively. @worktycho would you know how to list the difference between two memory snapshots? I'd like to compare the allocated blocks between two snapshots of the same process, taken a few minutes apart.