How can I tell if a memory leak is in user space or kernel space?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
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:
(1) Free memory ($ free -m
) is continuously consumed while running my application. At a steady state, it consumes about 5MB/minute.
(2) 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.
(3) When I stop my application, the memory is not returned to the system. The memory is returned only after a power cycle.
(4) 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.
(5) inspection of the smaps file shows that, over time, the older snapshot has consumed more memory. There are also more "anon_inode:dmabuf" entries in the older snapshot, and this looks similar to these issues:
https://stackoverflow.com/questions/28097766/where-does-the-dev-zero-deleted-anon-inodedmabuf-comes-from-in-proc-p
https://bugs.freedesktop.org/show_bug.cgi?id=100298
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?
memory wayland opengl
add a comment |Â
up vote
0
down vote
favorite
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:
(1) Free memory ($ free -m
) is continuously consumed while running my application. At a steady state, it consumes about 5MB/minute.
(2) 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.
(3) When I stop my application, the memory is not returned to the system. The memory is returned only after a power cycle.
(4) 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.
(5) inspection of the smaps file shows that, over time, the older snapshot has consumed more memory. There are also more "anon_inode:dmabuf" entries in the older snapshot, and this looks similar to these issues:
https://stackoverflow.com/questions/28097766/where-does-the-dev-zero-deleted-anon-inodedmabuf-comes-from-in-proc-p
https://bugs.freedesktop.org/show_bug.cgi?id=100298
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?
memory wayland opengl
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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:
(1) Free memory ($ free -m
) is continuously consumed while running my application. At a steady state, it consumes about 5MB/minute.
(2) 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.
(3) When I stop my application, the memory is not returned to the system. The memory is returned only after a power cycle.
(4) 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.
(5) inspection of the smaps file shows that, over time, the older snapshot has consumed more memory. There are also more "anon_inode:dmabuf" entries in the older snapshot, and this looks similar to these issues:
https://stackoverflow.com/questions/28097766/where-does-the-dev-zero-deleted-anon-inodedmabuf-comes-from-in-proc-p
https://bugs.freedesktop.org/show_bug.cgi?id=100298
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?
memory wayland opengl
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:
(1) Free memory ($ free -m
) is continuously consumed while running my application. At a steady state, it consumes about 5MB/minute.
(2) 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.
(3) When I stop my application, the memory is not returned to the system. The memory is returned only after a power cycle.
(4) 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.
(5) inspection of the smaps file shows that, over time, the older snapshot has consumed more memory. There are also more "anon_inode:dmabuf" entries in the older snapshot, and this looks similar to these issues:
https://stackoverflow.com/questions/28097766/where-does-the-dev-zero-deleted-anon-inodedmabuf-comes-from-in-proc-p
https://bugs.freedesktop.org/show_bug.cgi?id=100298
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?
memory wayland opengl
memory wayland opengl
asked 6 mins ago
Mr Stinky
1747
1747
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475298%2fhow-can-i-tell-if-a-memory-leak-is-in-user-space-or-kernel-space%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password