Skip to content
Advertisement

How do I find a system memory leak in linux?

I’ve got a monolithic piece of software, a game on a basic linux kernel, that seems to leak memory in swap space. The memory usage of the process itself is reported as constant over a day or so but the free memory on the system is consistently decreasing until there is no more physical ram space. There is no other software running other than the standard X server and debian system daemons. There are many usb devices connected that use libusb.

This is not a typical new/delete leak.

I’m at a loss as to where to look for system resources that are consumed and not freed. It’s not OpenGL, all allocated OGL memory is freed and I see that in the logs. Is it possible for the driver to be misbehaving outside of the process though?

So basically the question is, what kinds of resources can be used by a program that when not released will continue to leak system memory even after the program has exited?

Possible item: I’ve read in places that mmap, when used incorrectly can leak system memory. But the places where that is used in this software are not being run in this test case.

Advertisement

Answer

After quite a few tests the issue was definitively caused with a previous version of NVidia’s graphics driver leaking kernel memory. An upgrade solves the issue. For anyone interested, the leaky version was: 343.36 / running on 750Ti

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement