I have a large multi-threaded open source application which uses proprietary OpenGL libraries, Wayland Weston, and a proprietary graphics driver in the Linux kernel. The drivers are currently under development, so there is a strong possibility that they have errors.
I have observed the following symptoms:
Free memory (
free -m) is continuously consumed while running my application. At a steady state, it consumes about 1MB/5minutes.
If I stop and start my application continuously, I am able to accelerate the rate of memory loss. It looks like I lose about 0.5MB every time I restart the application.
When I stop my application, the memory is not returned to the system. The memory is returned only after a power cycle.
I have started to log memory usage, as well as taking snapshots of
/proc/<pid>/smaps. I can see which thread consumes the memory, and I will investigate further.
inspection of the smaps file shows that, over time, the older snapshot has consumed more memory. There are also more
anon_inode:dmabufentries in the older snapshot, and this looks similar to these issues:
Is this memory leak more likely to be a user space memory leak or a kernel memory leak?
What other diagnostics can I perform to narrow down the likely source of leaks?