Results 1 to 4 of 4
Hi all,
Is there any way to find that in a process how much memory has been allocated by a .so file dynamically.
-- Please suggest
Regards,
Manish Gurnaney...
- 06-24-2010 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 7
Memory taken by .So file
Hi all,
Is there any way to find that in a process how much memory has been allocated by a .so file dynamically.
-- Please suggest
Regards,
Manish Gurnaney
- 06-24-2010 #2Just Joined!
- Join Date
- Jun 2010
- Posts
- 3
does the trickCode:pmap <pid>
- 06-24-2010 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 7
Memory taken by .So file
Hi,
I have already gone through that option it gives the code segment and Data segment memory properly. But when it comes to heap memory it combines memory of all the .so files and process, and displays.
My Requirement here is that i want to know in a particular process how much memory of heap is asked for a particular lib file.
Regards,
Manish
- 06-24-2010 #4Just Joined!
- Join Date
- Jun 2010
- Posts
- 3
I don't know if such a tool exists, but I have a suggestion.
Use mtrace()/muntrace() to start and stop malloc tracing. When you call muntrace() before freeing memory, it shows up as memory not freed along the address where it was malloced. This list contains all the mallocs, including the ones malloced from .so. To filter just the .so contents, use pmap to find the address range of the .so code. You might have to write a small script to filter the contents based on this address range and add it.
Hope this helps !


Reply With Quote