LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 02-04-2010, 07:29 AM   #1
czezz
Member
 
Registered: Nov 2004
Location: Poland/Warsaw
Distribution: Slackware/Solaris
Posts: 550

Rep: Reputation: 30
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 ?

Last edited by czezz; 02-04-2010 at 07:41 AM.
 
Old 02-04-2010, 07:54 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
What return these commands:
Code:
prstat -c -n 5 -Z 1 1
swap -s
swap -l
 
Old 02-04-2010, 08:31 AM   #3
czezz
Member
 
Registered: Nov 2004
Location: Poland/Warsaw
Distribution: Slackware/Solaris
Posts: 550

Original Poster
Rep: Reputation: 30
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
 
Old 02-04-2010, 09:05 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Your zone is possibly set with memory capping.
 
Old 02-05-2010, 02:16 AM   #5
czezz
Member
 
Registered: Nov 2004
Location: Poland/Warsaw
Distribution: Slackware/Solaris
Posts: 550

Original Poster
Rep: Reputation: 30
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)

Last edited by czezz; 02-05-2010 at 03:07 AM.
 
Old 02-05-2010, 03:18 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by czezz View Post
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 ?
 
Old 02-05-2010, 03:49 AM   #7
czezz
Member
 
Registered: Nov 2004
Location: Poland/Warsaw
Distribution: Slackware/Solaris
Posts: 550

Original Poster
Rep: Reputation: 30
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.
 
Old 02-05-2010, 04:20 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.
 
Old 02-05-2010, 04:59 AM   #9
czezz
Member
 
Registered: Nov 2004
Location: Poland/Warsaw
Distribution: Slackware/Solaris
Posts: 550

Original Poster
Rep: Reputation: 30
Question

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.
 
Old 02-05-2010, 05:03 AM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
The above is false. Virtual Memory includes Physical Memory so swap should be equal to or larger than physical.
 
Old 02-05-2010, 06:08 AM   #11
czezz
Member
 
Registered: Nov 2004
Location: Poland/Warsaw
Distribution: Slackware/Solaris
Posts: 550

Original Poster
Rep: Reputation: 30
Nevertheless it shouldnt indicate 5Gb of free memory... but it does.
How to display correct free memory ?
 
Old 02-05-2010, 06:20 AM   #12
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Why wouldn't it ? vmstat values are correct, as far as the kernel is concerned.
 
Old 02-05-2010, 06:48 AM   #13
czezz
Member
 
Registered: Nov 2004
Location: Poland/Warsaw
Distribution: Slackware/Solaris
Posts: 550

Original Poster
Rep: Reputation: 30
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 ?
 
Old 02-05-2010, 07:14 AM   #14
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,481

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.
 
Old 02-05-2010, 07:45 AM   #15
czezz
Member
 
Registered: Nov 2004
Location: Poland/Warsaw
Distribution: Slackware/Solaris
Posts: 550

Original Poster
Rep: Reputation: 30
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 ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
top shows high memory used but processes don't add up mohitanchlia Linux - General 2 04-08-2009 10:08 PM
vmstat and sar -r free memory discrepancy AlucardZero Solaris / OpenSolaris 31 03-26-2009 10:42 AM
Top shows virtual memory use by proccess more than physical RAM! help! aznblood Linux - Software 2 08-21-2008 09:19 AM
Free Memory according to vmstat Camino Linux - Newbie 3 02-27-2006 09:27 AM
Firefox gets stuck... top shows 98-99% memory usage amitsharma_26 Linux - General 26 12-28-2005 03:01 PM


All times are GMT -5. The time now is 01:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration