This discussion is archived
6 Replies Latest reply: Mar 6, 2012 7:02 AM by bobthesungeek76036 RSS

Available swap space problem in solaris 10

921600 Newbie
Currently Being Moderated
Dear All,

Currently I am facing a most interesting problem regarding swap space.


We have assigned mirrored slice swap space with 20G size. But when we are asking for swap space it is only showing around 2GB.

1. Please have the swap area:

root@palash # swap -l
swapfile dev swaplo blocks free
/dev/md/dsk/d1 85,1 16 41945456 35002784

root@palash # swap -s
total: 53562072k bytes allocated + 5689008k reserved = 59251080k used, 615704k available

2. Please have the metastat output:

root@palash # metastat d1
d1: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d21
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 41945472 blocks (20 GB)

d11: Submirror of d1
State: Okay
Size: 41945472 blocks (20 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s1 0 No Okay Yes


d21: Submirror of d1
State: Okay
Size: 41945472 blocks (20 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s1 0 No Okay Yes

3. Here is /etc/vfstab entry for swap:

/dev/md/dsk/d1 - - swap - no -

4. But when we checked swap space using df command:

root@palash # df -h
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d0 18G 7.7G 9.9G 44% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap                   1.7G   1.7M   1.7G     1%    /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
18G 7.7G 9.9G 44% /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
18G 7.7G 9.9G 44% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd 0K 0K 0K 0% /dev/fd
swap 1.7G 184K 1.7G 1% /tmp
swap 1.7G 64K 1.7G 1% /var/run
/dev/dsk/c2t40d0s4 20G 20M 19G 1% /redo2
/dev/dsk/c2t40d0s1 276G 223G 50G 82% /oradata2
/dev/dsk/c3t40d0s3 195G 198M 193G 1% /restore
/dev/dsk/c2t40d0s0 276G 216G 57G 80% /oradata1
/dev/dsk/c2t40d0s5 59G 60M 58G 1% /system1
/dev/dsk/c3t40d0s0 276G 220G 53G 81% /index1
/dev/md/dsk/d3 30G 24G 5.7G 81% /oracle
/dev/dsk/c3t40d0s1 197G 53G 142G 28% /archive1
/dev/dsk/c2t40d0s3 20G 20M 19G 1% /redo1
/vol/dev/dsk/c0t6d0/disk1
0K 0K 0K 0% /cdrom/disk1


Please help me to indentify the reason.
  • 1. Re: Available swap space problem in solaris 10
    bigdelboy Pro
    Currently Being Moderated
    Your machine has X gigabytes of total ram.
    My interpretation is , sometimes known to be a little bit bucket and shovel mathematics and a little iffy and sometimes downwright wrong:


    You have allocated a swap file of 20GB

    You therefore have the ability to use X+20GB of virtual memory.

    swap -s shows 600MB of virtual memory free.

    So you seem to be using approx X+20GB - 0.6GB of virtual memory.

    ......

    You do not seem have zones, zones.max-swap or the (evil) zfs arc cache to deal with, so that keeps things a little simpler.

    .....

    I would prepare to allocate a larger swap file short term, but I am known to misinterpret these things from time to time so you might wish to wait for a peer review ... but i wouldn't wait if swap -s starts to get lower or you decide to write some big files into /tmp.

    .....
  • 2. Re: Available swap space problem in solaris 10
    921600 Newbie
    Currently Being Moderated
    Hello,

    Thanks for your reply.

    But I am not clear about your findings as we have around 64GB physical RAM in my machine.

    My question is that if we mount 20GB swap partition, then how we can see this is around less than 2 GB in df -h command.

    And even in swap -s command, this is showing same problem.

    What might be reason behind this????

    //Palash
  • 3. Re: Available swap space problem in solaris 10
    bigdelboy Pro
    Currently Being Moderated
    918597 wrote:
    Hello,

    Thanks for your reply.

    But I am not clear about your findings as we have around 64GB physical RAM in my machine.

    My question is that if we mount 20GB swap partition, then how we can see this is around less than 2 GB in df -h command.

    And even in swap -s command, this is showing same problem.

    What might be reason behind this????

    //Palash
    Well no-one else has anwered ... so its back to me.....

    Hmmm ... i would use the word observations rather than findings .... I am not on an old root explotation expedition all over our server .. merely observing on the morsels you show me ....

    Please be aware I may not be totally technically correct or be using right terminology on what follows so I welcome corrections ....

    Your machine has 64GB Memory, and a 20 GB swap file, therefore has the ability up to support 84GB total (Virtual) Memory ofr it's processes/buffers.

    The reason little swap is free (let us say 2GB ... thoug it may be 600m) is theat processes/buffers have a virutal memory requirement of 84GB-2GB = 82Gb.

    ... So rather than wondering about how come 2GB is left, start thinking about ow 82GB is being used.

    ...... Particularly with databases oracle RDBMS; mysql etc a big influencing factor can be how much memory is allocated its memory structures.
    .......... And a DBA may set these extremely high (memory_max / innodb-buffer-pool-size etc etc).

    ps -ef will show the (virtual) 'size' for individual processes
    prstat -a may help show what is going on (but may double account some things):
    ipcs -a would show the allocation for the oracle RDBMS memory_area,
    echo ::memstat | mdb -k ### may help ... but i have seen accounts of it taking ages to run.

    I'd also check kstat zfs ... but your not using zfs so no need to bother.


    .... You may need to show some evidence of how your applications are consuming virutal memory for someone to help you futher ... but if you do htis who may answer your own quesiton.
  • 4. Re: Available swap space problem in solaris 10
    bobthesungeek76036 Pro
    Currently Being Moderated
    You are confusing swap space with tmpfs space. You clearly have 20GB of swap as shown with the swap command. The key here is the "available" parameter. The disk space you are looking as is not "swap" but a "tmpfs" mount. If you run the command "mount -p | grep swap" you will see they are tmpfs filesystems:

    $ mount -p | grep swap
    swap - /etc/svc/volatile tmpfs - no xattr
    swap - /tmp tmpfs - no xattr
    swap - /var/run tmpfs - no xattr
    $

    Do a "man tmpfs" for details but basically tmpfs is comprised of available swap + available memory and it will grow and shrink as memory is available.
  • 5. Re: Available swap space problem in solaris 10
    921600 Newbie
    Currently Being Moderated
    Dear All,

    Thanks a lot for writing on my case.

    As per your suggestion I have checked everything except Oracle max memory/other configuration.

    As per my understanding, knowledge I have ever experienced this situation.

    My question is very simeple.

    We mount 20G disk slice & we have 64G physical memory in system. But we are not getting total memory from any corner ( swap -s or df -h )

    You can also check my metastat d1 & /etc/vfstab configuraiton.

    Anyway I am planning to restart the whole system one time & let see one time.


    //Palash
  • 6. Re: Available swap space problem in solaris 10
    bobthesungeek76036 Pro
    Currently Being Moderated
    Because you have some shared memory processes the numbers will be a little skewed but here's a handy little command that will show you the resident size of the processes you have running sorted by the heaviest hitters:

    <pre>ps -eo user,pid,ppid,s,stime,rss,vsz,time,comm | head -1 ; ps -eo user,pid,ppid,s,stime,rss,vsz,time,comm |tail +2| sort -r +5</pre>

    The fifth column (RSS) will be the resident memory size of the process.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points