Jordi
2011-09-08 14:25:49 UTC
Hi all,
I'm using this script to get the memory stats in some servers:
http://www.brendangregg.com/k9toolkit.html
It's pretty cool and works well. The problem is I have several boxes
with a lot of RAM Locked (Locked memory pages from swap). Ex:
$ /usr/local/scripts/admintools/swapinfo
RAM _____Total 49141.8 Mb
RAM Unusable 1290.1 Mb
RAM Kernel 3437.2 Mb
RAM Locked 18620.5 Mb
RAM Used 23747.2 Mb
RAM Avail 2046.8 Mb
Disk _____Total 32773.2 Mb
Disk Alloc 9387.4 Mb
Disk Free 23385.9 Mb
Swap _____Total 72248.7 Mb
Swap Alloc 51453.5 Mb
Swap Unalloc 1142.9 Mb
Swap Avail 19652.3 Mb
Swap (MinFree) 6141.7 Mb
As you can see in this machine I have almost 19GB locked (RAM
Locked 18620.5 Mb). A lot of!
So, is clear I want to "clean up" this memory. I've read a bit:
http://blogs.oracle.com/jimlaurent/entry/solaris_faq_myths_and_facts
http://www.softpanorama.org/Solaris/Processes_and_memory/swap_space_management.shtml
My understanding is I can "free" this locked RAM by SWAP simply shutting
down the SWAP device and then activating it again:
$ swap -d /device
$ swap -a /device
But the problem is, by default, we're using the next vfstab:
$ cat /etc/vfstab
#device device mount FS fsck mount
mount
#to mount to fsck point type pass at boot
options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s1 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1
no -
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /var ufs 1
no -
/dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /home ufs 2
yes -
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /opt ufs 2
yes -
/devices - /devices devfs - no -
sharefs - /etc/dfs/sharetab sharefs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -
So I cannot simply turn off the SWAP.
Is it possible to free all this locked RAM in SWAP? How?
Anotheer question will be of is there some way to limit the amount of
"lockable" RAM memory from SWAP...
Thanks for all.
I'm using this script to get the memory stats in some servers:
http://www.brendangregg.com/k9toolkit.html
It's pretty cool and works well. The problem is I have several boxes
with a lot of RAM Locked (Locked memory pages from swap). Ex:
$ /usr/local/scripts/admintools/swapinfo
RAM _____Total 49141.8 Mb
RAM Unusable 1290.1 Mb
RAM Kernel 3437.2 Mb
RAM Locked 18620.5 Mb
RAM Used 23747.2 Mb
RAM Avail 2046.8 Mb
Disk _____Total 32773.2 Mb
Disk Alloc 9387.4 Mb
Disk Free 23385.9 Mb
Swap _____Total 72248.7 Mb
Swap Alloc 51453.5 Mb
Swap Unalloc 1142.9 Mb
Swap Avail 19652.3 Mb
Swap (MinFree) 6141.7 Mb
As you can see in this machine I have almost 19GB locked (RAM
Locked 18620.5 Mb). A lot of!
So, is clear I want to "clean up" this memory. I've read a bit:
http://blogs.oracle.com/jimlaurent/entry/solaris_faq_myths_and_facts
http://www.softpanorama.org/Solaris/Processes_and_memory/swap_space_management.shtml
My understanding is I can "free" this locked RAM by SWAP simply shutting
down the SWAP device and then activating it again:
$ swap -d /device
$ swap -a /device
But the problem is, by default, we're using the next vfstab:
$ cat /etc/vfstab
#device device mount FS fsck mount
mount
#to mount to fsck point type pass at boot
options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s1 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1
no -
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /var ufs 1
no -
/dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /home ufs 2
yes -
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /opt ufs 2
yes -
/devices - /devices devfs - no -
sharefs - /etc/dfs/sharetab sharefs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -
So I cannot simply turn off the SWAP.
Is it possible to free all this locked RAM in SWAP? How?
Anotheer question will be of is there some way to limit the amount of
"lockable" RAM memory from SWAP...
Thanks for all.