missing swap space?


 
Thread Tools Search this Thread
Operating Systems Solaris missing swap space?
# 1  
Old 01-06-2011
missing swap space?

I googled but couldn't figure out where the swap space is.

Code:
bash-3.00# swap -l
swapfile             dev  swaplo blocks   free
/dev/md/dsk/d10     85,10     16 16780208 16780208 (=8G)

bash-3.00# swap -s
total: 10394200k bytes allocated + 440712k reserved = 10834912k used, 859648k available (=840M)

bash-3.00# uname -a
SunOS aaa 5.10 Generic_127111-09 sun4v sparc SUNW,SPARC-Enterprise-T2000

bash-3.00# prtconf|grep Mem
Memory size: 32640 Megabytes

man swap says swap -s counts in swap space in both disk and physical memory. The system should have more than 8G available swap space right? How come the total available 859648k in output of swap -s is much less than free space in o/p of swap -l (8G) ? Am I missing anything here?
# 2  
Old 01-06-2011
These commands are measuring different things even while they share the same name (swap).

"swap -l" is telling the swap area (i.e. on disk) whole size and free size.

"swap -s" is reporting virtual memory usage.

It seems your whole virtual memory size is 11.5 GB while you have 32 GB or RAM and 8 GB of swap space. I would guess you are using a big bunch of kernel RAM, which isn't virtual memory, likely for ZFS cache.

What says:
Code:
echo ::memstat | mdb -k

?

Last edited by jlliagre; 01-06-2011 at 07:40 PM..
# 3  
Old 01-06-2011
Code:
bash-3.00# echo ::memstat | mdb -k
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                    2082412             16268   50%
Anon                      1293667             10106   31%
Exec and libs               29124               227    1%
Page cache                 143563              1121    3%
Free (cachelist)           209266              1634    5%
Free (freelist)            397452              3105   10%

Total                     4155484             32464
Physical                  4089558             31949

So you mean the o/p of swap -s doesn't include swap in disk at all? I did a test on my x86 Solaris 10 VM by adding a 1G swap device. The "available" size of "swap -s" WAS increased by 1G accordingly:

Code:
bash-3.00# swap -l
swapfile             dev  swaplo blocks   free
/dev/zvol/dsk/rpool/swap 181,1       8 1048568 1048568
bash-3.00# swap -s
total: 356432k bytes allocated + 159864k reserved = 516296k used, 350344k available

bash-3.00# swap -a /dev/dsk/c1t1d0p0

bash-3.00# swap -l
swapfile             dev  swaplo blocks   free
/dev/zvol/dsk/rpool/swap 181,1       8 1048568 1048568
/dev/dsk/c1t1d0p0   30,144      8 2097136 2097136

bash-3.00# swap -s
total: 356256k bytes allocated + 159436k reserved = 515692k used, 1399180k available

bash-3.00# swap -d /dev/dsk/c1t1d0p0

bash-3.00# swap -l
swapfile             dev  swaplo blocks   free
/dev/zvol/dsk/rpool/swap 181,1       8 1048568 1048568

bash-3.00# swap -s
total: 358208k bytes allocated + 159532k reserved = 517740k used, 368716k available

Is it possible that the "free" showed by swap -l is incorrect? Looks quite confusing to me.
# 4  
Old 01-06-2011
I presume swap is mounted on /tmp as tmpfs ? If so then the files in /tmp may account for the discrepency...
# 5  
Old 01-06-2011
On that system /tmp is on a dedicated partition.
Code:
bash-3.00# df -h /tmp
Filesystem             size   used  avail capacity  Mounted on
/dev/md/dsk/d40        2.0G   973M   977M    50%    /tmp

# 6  
Old 01-06-2011
give the output of "df -h" please...
# 7  
Old 01-06-2011
Quote:
Originally Posted by beerd
Code:
bash-3.00# echo ::memstat | mdb -k
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                    2082412             16268   50%
...

Hmm, 16 GB used by the kernel, that's a lot of RAM ...
Are you running LDOMs and/or zones on that box ?
Is there some resource capping in place ?
Quote:
So you mean the o/p of swap -s doesn't include swap in disk at all?
No. I only mean these metrics are not strictly related. For example, you can run out of swap (as reported by swap -s) with all swap space free (swap -l) and even plenty of RAM available. Free virtual memory and free swap are different concepts, although your tests demonstrate there is a relation between them.

By the way, as your swapfile is reported to be unused, did you try to remove it (swap -d ...) and see how the "swap -s" figures evolve. Also, how is adding a new swap device (you can use a file for testing) impacting your measurements ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Swap space not getting used

CENT OS 5.8 server running with a huge java application which uses up all my ram (4GB) and requires excess of atleast 2GB.But the swap is not getting used up((8GB) of swap space left unused) leading a wierd error and stopping application to stop working. Any one here dealt with the same kind of... (2 Replies)
Discussion started by: shiek.kaleem
2 Replies

2. Solaris

Swap space

Dear All, I have a swap space of 16G available in Sol 10. I have allocated it as a seperate file system. But when the RAM Is full used , the system gets rebooted and the swap is not being used,. Any reasons for this. Rgds Rj (5 Replies)
Discussion started by: jegaraman
5 Replies

3. Linux

How to reclaim the space which i used to increse the swap space on Xen,

Hi, i have done a blunder here, i increased the swap space on Xen5.6 server machine using below steps :- 1056 dd if=/dev/zero of=/root/myswapfile bs=1M count=1024 1057 ls -l /root/myswapfile 1058 chmod 600 /root/myswapfile 1059 mkswap /root/myswapfile 1060 swapon /root/myswapfile ... (1 Reply)
Discussion started by: apm
1 Replies

4. Solaris

Swap Space

Could someone please explain how you know how much swap space you have on your system. See below: # swap -s total: 8225048k bytes allocated + 4863488k reserved = 13088536k used, 4008032k available # swap -l swapfile dev swaplo blocks free /dev/dsk/c3t0d0s1 32,25 16... (2 Replies)
Discussion started by: jamba1
2 Replies

5. Solaris

swap space confusions

hi, i am a little bit confused over swap space issues on solaris. what i know is that mostly all solaris swap space is configured on /tmp as a tmpfs. but i do receive alerts from my monitoring server that one of my server has exceeded 95% treshold. when checked at tmp, it shows only 12%. ... (1 Reply)
Discussion started by: cromohawk
1 Replies

6. Linux

swap space

Hi, I want to know how can i free the swap space if it is completely full, 0 mb remaining, (1 Reply)
Discussion started by: manoj.solaris
1 Replies

7. UNIX for Dummies Questions & Answers

Swap space used???

Plz I need to know how much swap mem free and used i have. I'm using Compaq Tru64 UNIX V5.1A (rev 1885) Thanx (1 Reply)
Discussion started by: Lestat
1 Replies

8. AIX

swap space / paging space

how do you get the paging space reduced without rebooting the machine ? the os is aix (2 Replies)
Discussion started by: aaronh
2 Replies

9. UNIX for Dummies Questions & Answers

pageing space vs swap space

Hello, I would like to know if there is any difference between the pageing space and the swap space. Thank you in advance. (1 Reply)
Discussion started by: VeroL
1 Replies

10. UNIX for Dummies Questions & Answers

SWAP SPACE

All, I am using SOLARIS 7. I have formated my hard drive to consist of only 150MB of swap space. This isn't enough considering I am running Oracle. How do I create additional swap space? Please list sources or commands. PS mkswap doesn't work on my machine. ( I have swap and... (5 Replies)
Discussion started by: SmartJuniorUnix
5 Replies
Login or Register to Ask a Question