Skip to content

Heap memory usage lower than resident size. How to track the leaks ? #331

Closed Answered by pablogsal
ashajkofci asked this question in Q&A
Discussion options

You must be logged in to vote

. Do you have any idea on how I could debug this issue ?

Debugging "leaking" resident size programs is always a bit of a challenge because you are dealing with underlying allocators most of the time and unless you have any visibility into those is very difficult to diagnose. You have some possibilities if you are using glibc you can use the malloc_stats call to get some statistics on the internal allocator to see if fragmentation may be a problem. Check this for more information.

If you are feeling adventurous, glibc has a bunch of tunables that you can try to help with fragmentation if that turns out to be the case:

https://www.gnu.org/software/libc/manual/html_node/Malloc-Tunable-Para…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@jstriebel
Comment options

@pablogsal
Comment options

@ashajkofci
Comment options

Answer selected by pablogsal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants