LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   vmstat and top shows wrong free memory ? (https://www.linuxquestions.org/questions/solaris-opensolaris-20/vmstat-and-top-shows-wrong-free-memory-786945/)

czezz 02-04-2010 07:29 AM

vmstat and top shows wrong free memory ?
 
I have installed "top" to monitor memory usage (Solaris 10 10/09 s10s_u8wos_08a SPARC).
It shows, more or less, this same what vmstat. Free memory = 5580M

Code:

Memory: 2048M phys mem, 5580M free mem, 1024M total swap, 958M free swap
Code:

vmstat 1 3
 kthr      memory            page            disk          faults      cpu
 r b w  swap  free  re  mf pi po fr de sr s0 s1 s2 s3  in  sy  cs us sy id
 0 0 0 13783928 6501944 1 2  0  0  0  0  1  2  2  3  3  280 1414  132  3  1 96
 0 0 0 13006624 5714672 7 37 0  0  0  0  0  0  0  0  0  231  734  25  0  0 100
 0 0 0 13006464 5714512 4 4  0  0  0  0  0  0  0  0  0  218  695  26  1  0 99

Can anyone explain me how is this possible I have 5580M free mem.
Please note that:
Physical Memory: 2048M
Total Swap: 1024M
So how is that possible i see: 5580M free mem ?

jlliagre 02-04-2010 07:54 AM

What return these commands:
Code:

prstat -c -n 5 -Z 1 1
swap -s
swap -l


czezz 02-04-2010 08:31 AM

Here you go: (executed on logical zone)
Code:

bash-3.00# prstat -c -n 5 -Z 1 1
  PID USERNAME  SIZE  RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
 16724 root      28M  14M run    45    0  0:01:53 6.5% nco_p_mttrapd/10
 17641 root      101M  38M sleep  59    0  0:00:01 2.8% java/10
 16757 root      25M  12M sleep  59    0  0:00:18 1.0% nco_p_syslog/8
 17135 root      49M  30M sleep  59    0  0:00:03 0.5% nco_p_oracle_10/7
 16856 root      25M  11M sleep  59    0  0:00:05 0.2% nco_p_glf/7
ZONEID    NPROC  SWAP  RSS MEMORY      TIME  CPU ZONE
    1      45  113M  208M    10%  0:10:48  11% probe1
Total: 45 processes, 196 lwps, load averages: 0.13, 0.09, 0.07

Code:

bash-3.00# swap -s
total: 114064k bytes allocated + 0k reserved = 114064k used, 934512k available

Code:

bash-3.00# swap -l
swapfile            dev  swaplo blocks  free
/dev/swap          4294967295,4294967295    16 2097152 1868992


jlliagre 02-04-2010 09:05 AM

Your zone is possibly set with memory capping.

czezz 02-05-2010 02:16 AM

memory capping - so memory should be limited ?
How can I see what is the size of all memory on logical zone ?
Here is what I see on global zone for logical zone:

Code:

[root@host /]# zonecfg -z probe1 info
zonename: probe1
zonepath: /zones/probe1
brand: native
autoboot: true
bootargs: -m verbose
pool: probe1
limitpriv:
scheduling-class:
ip-type: shared
net:
        address: 192.168.15.134
        physical: bge1
        defrouter: 192.168.15.1
capped-memory:
        physical: 2G
        [swap: 1G]
        [locked: 1G]
attr:
        name: comment
        type: string
        value: "Probe1 zone"
rctl:
        name: zone.max-swap
        value: (priv=privileged,limit=1073741824,action=deny)
rctl:
        name: zone.max-locked-memory
        value: (priv=privileged,limit=1073741824,action=deny)


jlliagre 02-05-2010 03:18 AM

Quote:

Originally Posted by czezz (Post 3853534)
memory capping - so memory should be limited ?

I don't get the question but your zone is definitely configured with memory capping.
Quote:

How can I see what is the size of all memory on logical zone ?
The size of what memory:
RAM installed ?
Virtual Memory available to the zone ?
Something else ?

czezz 02-05-2010 03:49 AM

Quote:

I don't get the question but your zone is definitely configured with memory capping.
If memory is limited then it shouldent be greater that set values.
In my config:
physical: 2G
swap: 1G

What I see on logical zone is:
Physical Memory: 2048M
Total Swap: 1024M

but Free Memory is: 5580M - that is impossible !
All I need is to know what free memory is for real.

jlliagre 02-05-2010 04:20 AM

What is the free memory value you are interested in ?
Having the zone set with less swap (ie VM) than RAM doesn't make much sense in my opinion.

czezz 02-05-2010 04:59 AM

OK, let me introduce my problem in other way:

1. Total Memory (Swap and Physical) on local zone is:
physical: 2G
swap: 1G

Assuming Total avalible memory = phisical + swap
2 + 1 = 3 Gb

2. If above is true, how is that possible that top and vmstat show Free Memory above 5 Gb ? It should be below 3 Gb.

jlliagre 02-05-2010 05:03 AM

The above is false. Virtual Memory includes Physical Memory so swap should be equal to or larger than physical.

czezz 02-05-2010 06:08 AM

Nevertheless it shouldnt indicate 5Gb of free memory... but it does.
How to display correct free memory ?

jlliagre 02-05-2010 06:20 AM

Why wouldn't it ? vmstat values are correct, as far as the kernel is concerned.

czezz 02-05-2010 06:48 AM

Come on Jlliagre, how can it be ?
If physical is 2Gb and Swap 1Gb then free mem shouldnt be/cant be greater than 3 Gb. (In fact it shows more than 5 Gb).

Can you please explain me this/what im reading wrong ?

jlliagre 02-05-2010 07:14 AM

I already did but you failed to read/understand it.

Physical and swap do not add. You have capped the memory for the zone to 1 GB, not 3GB, your 2GB physical capping is pointless.

The kernel isn't subject to memory capping so reports it has 5 GB free. With OS level virtualization, there is a single kernel shared by all zones.

czezz 02-05-2010 07:45 AM

Ok, now I think I got it.
So the local zone reports free memory which in fact free memory of global zone.

If I understand you correctly:
to read correct value of free memory on local zone I should enlarge swap (to 2 GB or more) for that logical zone ? Is this right ?


All times are GMT -5. The time now is 10:53 PM.