You can use "prstat -cZ 1 1" to get the resident memory in use by each zone.
This command counts shared pages correctly. It uses a private interface.
On Wed, Apr 08, 2009 at 03:52:01PM -0700, OpenSolaris Forums wrote:
> Hello Bart,
> thanks for your suggestion... but I have another question
> using the suggested prxmap struct I can obtain the private memory usage for
> each process, but I will lose all the information about the shared memory....
> let me better explain the problem with an example:
> Zone_1 -> Process_A -> Memory: 100 MB (90 shared + 10 private)
> Zone_2 -> Process_B -> Memory: 150 MB (90 shared + 60 private)
I think Bart means that you can keep track of shared objects found in
processes from the same zone, so that you only count them once.
The issue will be with shared anon mappings with shmid == -1. These mappings
will have pr_mapname of "", and a pr_dev equal to PRNODEV, so there is no way
to track which one is which. Enhancing pr_xmap to give a unique pr_mapname
to such mappings would help resolve this.
> in this way I'll say that in Zone_1 there are 10 MB used and in Zone_2 there
> are 60 MB used.... but in which zone I should sum the shared MBs?
> Is there a way to use some API in order to collect the memory usage of each
> zone from the global zone in order to avoid this kind of problem?
> Thanks in advance
> This message posted from opensolaris.org
> zones-discuss mailing list
zones-discuss mailing list