Eric Lowe wrote:
> Garrett D'Amore wrote:
>> It strikes me that this problem underscores that we need a better way to
>> monitor real memory usage -- perhaps looking at memory allocated via
>> brk() vs memory backed by mmap() of files (whether ordinary as in the
>> jar or special as in framebuffers.)
>
> RSS is purely a single-process concept; with shared libs it isn't very
> useful, since the degree of sharing determines the real % of memory
> used by each process sharing the underlying object.
>
> pmap(1) is a much more useful tool if you want to see how much memory
> is being used by a process since it breaks down usage by memory type.
> But it doesn't directly answer the question "how much memory is being
> used by Java on my system" when you have several Java VMs running; you
> have to figure that out by adding up the anon+heap+stack of each
> process and adding the shared library usage. Blech.
>
> We (the VM team) are looking into different possible solutions for
> memory usage observability for groups of processes such as all of the
> processes running in a zone, so you can tell how much physical memory
> is being used by that grouping of processes taking sharing into
> account. But that isn't perfect either -- any such tool would return a
> value == RSS for a single process, since you're essentially asking
> what a process' physical memory usage would be if it were running in
> isolation.
>
> - Eric
It would be meaningful to see the "shared pages" (or potentially shared,
shareable?) as a separate count.
But also, in most cases I've seen, the size of the shared libs pales
compared to the size of heap consumed.
X11 apps certainly have a number of shared libs -- libc ~1Mb, libgtk ~
2.8Mb, etc. (amd64 figures). But for the most part I look at "top"
and see things like Opera at ~97MB, thunderbird ~200M, firefox
~200MB. I doubt any of those have more than ~20MB of shared libs loaded.
-- Garrett
--
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134 Fax: 951 325-2191