Memory usage, free and used, using sar, top and vmstat in Solaris zone/container

Hi all,

I have a server running an Oracle database that is part of a Solaris M5000 container. Presumably this is referred to as a zone within a cluster, not sure if I get the terminology right.

Anyway, a third-party manages the zone and unfortunately is not "helpful/friendly" to assist me on how to check memory usage. Only info I got is that the server has been capped with a 8192M of memory.

Output from top shows as below:

Memory: 8192M phys mem, 72G free mem, 179G swap, 179G free swap

I assume this means the server has been allocated 8192M out of the container total of 72G.

Now I need to increase some Oracle parameter which presumably may or may not require more than the 8192M that the server has been allocated at the moment. Before doing that though, I want to know what is the current usage and free memory out of the 8129M that is currently allocated.

I thought if I run vmstat, it will show me how much of the 8192M is free but that does not seem to be the case.

The output of vmstat command is as below. The value under the free column seems to be for the whole Solaris container or am I wrong? How do I calculate how much of the allocated 8129M is used and how much is free?

Or should I be calculating the free memory of the zone as the (value of free from vmstat) - (value of free from top) in which case the memory used should then be 8192-((value of free from vmstat) - (value of free from top))

vmstat 5 10
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr lf s0 s1 s2   in   sy   cs us sy id
 0 4 0 253043824 92076232 14 42 15 0 0 0 0  0  0 10  0  384  634  212  2  3 94
 0 0 0 241363080 75768528 97 437 0 0 0 0 0  0  0  0  0   27 4770   63  3  7 89
 0 0 0 241337320 75743496 1 1 0 0  0  0  0  0  0  0  0   21 3925  103  1  4 95
 0 0 0 241329560 75735840 1 1 0 0  0  0  0  0  0  0  0   21 3531   26  2  4 95
 0 0 0 241357368 75764896 1 13 0 0 0  0  0  0  0 22  0   22 3560   56  1  4 95
 0 0 0 241341368 75772552 1 1 0 0  0  0  0  0  0  0  0   21 3501   20  2  3 95
 0 0 0 241357296 75774792 1 1 0 0  0  0  0  0  0 16  0   20 3652   27  1  4 95
 0 0 0 241364880 75779976 97 432 0 0 0 0 0  0  0  0  0   29 4584   66  3  8 89
 2 0 0 241364352 75779920 11 48 0 0 0 0  0  0  0  0  0   24 4018  128  2  4 94
 0 0 0 241358424 75774752 1 1 0 0  0  0  0  0  0  0  0   44 3482   21  1 29 70

I also tried using sar -r 5 10 and the output is as below and I should be able to get freemem =freemem*8 (pagesize=8k), is this correct? How to check what is the pagesize or is it always 8k for Solaris?

So for the sar output below, freemem = (10035380*8)/1024 = 78401.40625M, is this correct?

$ sar -r 5 10

SunOS camserver02 5.10 Generic_142900-14 sun4u    08/12/2010

22:02:02 freemem freeswap
22:02:07 10033571 483451427
22:02:12 10031976 483436909
22:02:17 10032355 483446381
22:02:22 10032384 483426890
22:02:27 10031904 483451523
22:02:32 10031876 483360378
22:02:37 10031266 483448275
22:02:42 10037833 483451718
22:02:47 10045598 483441792
22:02:52 10045397 483446253

Average  10035380 483436454

Alternatively, is there any other command that I can use to show memory used and free memory for the zone but not for the full container.

Any advise will be very much appreciated. Thanks in advance.

"rcapstat" and "prstat -Z" might help understanding your memory usage.

To know what is your page size, you simply run the "pagesize" command.