ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Measuring free memory is not an appropriate way to check for a memory leak, for a couple of reasons:

  • If there is lots of free memory, the OS may use it as a disk cache whenever it wants to (this is probably what you're seeing)
  • There are many other processes running on your system, and their memory consumption may vary.

If you want to check for memory leaks, use a memory check tool such as valgrind; these can track that each memory allocation call has a matching deallocation call, and can even give you hints about which allocations may be the source of memory leaks.