cynthia / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Why the memory use from heap profiler diff from that from linux-top-res #387

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. using heap profiler to analysis the program memmory
2. the memory use from heap profiler is 5206.5M
3. but from the linux top, the memory process is RES 1.4g, VIRT: 3774m, 
SHR 4292M

What is the expected output? What do you see instead?
How  5206.5M come from?

What version of the product are you using? On what operating system?
google-perftools-1.7, suse x64_64 

Please provide any additional information below.

Original issue reported on code.google.com by lshmouse on 30 Dec 2011 at 2:23

GoogleCodeExporter commented 9 years ago
What version of the product are you using? On what operating system?
google-perftools-1.7, suse x86_64 

Original comment by lshmouse on 30 Dec 2011 at 2:24

GoogleCodeExporter commented 9 years ago
You can use MallocExtension::instance()->GetStats() (or similar; I'm going from 
memory), to see how tcmalloc is accounting for its memory.

I do notice that RES+SHR is close to what the heap-checker is reporting.

Original comment by csilv...@gmail.com on 30 Dec 2011 at 2:46

GoogleCodeExporter commented 9 years ago
Does GetStats() answer your question?  If I don't hear back in a few days, I'll 
assume yes and close the bug. :-)

Original comment by csilv...@gmail.com on 26 Jan 2012 at 1:05

GoogleCodeExporter commented 9 years ago
sorry,  i do not have time to try that method because of chinese new year
holiday.

And i will try it and reply soon.

Original comment by lshmouse on 29 Jan 2012 at 9:29

GoogleCodeExporter commented 9 years ago
Yes, MallocExtension::instance()->GetStats() works and It sames that the memory 
showed in this method is same as that got from top RES. 

But i do not known what is difference.

Original comment by lshmouse on 31 Jan 2012 at 2:24

GoogleCodeExporter commented 9 years ago
Seems like everything is in order, then.  tcmalloc uses a lot of virtual memory 
but that shouldn't matter for anything.  I don't know where the shared memory 
is coming from, possibly .so files you have mapped in.  Looking at 
/proc/<pid>/maps may help clarify.

Original comment by csilv...@gmail.com on 31 Jan 2012 at 3:24