Out of swap but RAM available


 
Thread Tools Search this Thread
Operating Systems Solaris Out of swap but RAM available
# 1  
Old 08-17-2010
Out of swap but RAM available

Hi all,

The environment we're using is a T5440 running Solaris 10 LDOMs and zones configured within the LDOM. The LDOM has 32Gb of RAM and 32Gb of swap.
Last week, we had an issue where the MQ server on zone 3 crashed as it ran out of swap, apparently caused by zone 2 usage. I understand that RAM and swap are shared across the zones so that's understandable. The real issue appears to be that we're using up swap even though there is plenty of RAM still available. I'm not the SA, but I understand that there is no specific resource capping in place.
3 questions...
1) Has anyone come across this scenario before with swap being used, seemingly in preference to RAM!
2) What's the best way to determine what RAM and SWAP is being used by which processes, and can this be tracked dynamically? Would any tracking need to occur at the global level?
3) If we can determine a rogue process, can dtrace or similar be used to delve deeper?
# 2  
Old 08-17-2010
You are misunderstanding the issue. RAM and swap are related but different beasts. You can certainly exhaust your swap (a.k.a. virtual memory) while RAM is still available. Solaris doesn't overcommit memory so if you haven't swap enough to back memory reservations, you'll get what you observe.

"prstat -Z" and "swap -s" will help you investigating the issue.
# 3  
Old 08-17-2010
Clearly I am misunderstanding!Smilie I thought that RAM was used in preference, and when there wasn't enough available, the OS started swapping memory pages to disk. If this isn't the case, I'd appreciate a one paragraph tutorial on what really happens!
# 4  
Old 08-17-2010
Most UNIX systems will attempt to guarantee there's enough swap available for all allocated memory, instantiated or not. Things that allocate masses of memory but don't ever use it can exhaust all available swap space even though they never had any physical memory pages assigned to them.

(Linux systems are a bit unusual in generally having "virtual" swap, in which swap doesn't get assigned to allocated memory until it needs to be paged out. It will allow far more memory to be allocated than the system has swap, but if the processes in memory actually use more memory than it has mem + swap combined, processes will start being killed to reap memory.)

Last edited by Corona688; 08-17-2010 at 05:08 PM..
# 5  
Old 08-17-2010
Quote:
Originally Posted by JerryHone
I thought that RAM was used in preference, and when there wasn't enough available, the OS started swapping memory pages to disk.
That statement is correct but is unrelated to what you experience. As Corona688 already explained, the issue isn't with usage but reservation. Adding enough swap space for all reservations (malloc) to fit will fix the issue unless the is a memory leak.
# 6  
Old 08-17-2010
I'd just like to make sure I understand this...
Quote:
Originally Posted by Corona688
Most UNIX systems will attempt to guarantee there's enough swap available for all allocated memory, instantiated or not. Things that allocate masses of memory but don't ever use it can exhaust all available swap space even though they never had any physical memory pages assigned to them.
So, for example, I start a Java process that the OS knows may require 1Gb of space at some point in its life. Is the above statement saying that 1Gb of swap will be allocated and therefore unavailable for use by any other processes, but initially only, say, 100Mb will actually be utilised? And if I had 10 such Java processes, I've taken up a huge proportion of my available swap. However, as I've got 32Gb of physical RAM, the swap will never actually be utilised!?

Finally, the prstat -Z gives me SIZE and RSS values, and for each zone a SWAP, RSS and MEMORY column. What do these values represent?
# 7  
Old 08-17-2010
It's not that the OS knows it will require 1GB, it's that Java asked for 1GB. (Though some systems will reserve more than the program asks for anyway.) Otherwise, yes. This is to guarantee that even worst-case, when everything on the system decides to use all memory that's been allocated to it, the system actually has enough to do so.

Last edited by Corona688; 08-17-2010 at 06:56 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Explain the output of swap -s and swap -l

Hi Solaris Folks :), I need to calculate the swap usage on solaris server, please let me understand the output of below swap -s and swap -l commands. $swap -s total: 1774912k bytes allocated + 240616k reserved = 2015528k used, 14542512k available $swap -l swapfile dev swaplo... (6 Replies)
Discussion started by: seenuvasan1985
6 Replies

2. Red Hat

more swap and ram used in application

Hi All, I have a RAM of around 11 gig and swap of around 18 G in my Linux Server. But at some times , I find that All the RAM and 5 gig of swap is used in server...and i also got some advice from our discussion forums to increase the RAM . But nowadays what happens is the all the RAM... (1 Reply)
Discussion started by: jegaraman
1 Replies

3. Red Hat

RAM Size

Can anyone let me know whether there is a command to know the RAM capacity in GB? I have tried cat /proc/meminfo and free.But its not in GB. I need to use it in script. Thanks and Regards (4 Replies)
Discussion started by: Rupaa
4 Replies

4. HP-UX

Swap device file and swap sapce

Hi I have an integrity machine rx7620 and rx8640 running hp-ux 11.31. I'm planning to fine tune the system: - I would like to know when does the memory swap space spill over to the device swap space? - And how much % of memory swap utilization should be specified (swap space device... (6 Replies)
Discussion started by: lamoul
6 Replies

5. Solaris

How much portion of RAM is allocated to Swap space?

How swap is getting 12GB as its size as per the below output: Filesystem size used avail capacity Mounted on /dev/md/dsk/d0 7.9G 2.1G 5.7G 27% / /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 12G 1.2M 12G 1%... (3 Replies)
Discussion started by: ramnagaraj
3 Replies

6. Red Hat

swap not defined as swap

free -m : 1023 total swap space created default partition /dev/sdb1 50M using fdisk. i did write the changes. #mkswap /dev/sdb1 #swapon /dev/sdb1 free -m : 1078 total swap space this shows that the swap is on Question : i did not change the type LINUX SWAP (82) in fdisk. so why is... (5 Replies)
Discussion started by: dplinux
5 Replies

7. Red Hat

red hat Linux 5.0 is detecting 3gb ram but physical ram is 16gb

Hi, On server 64bit Hw Arch , Linux 5.0(32bit) is installed it is showing only 3gb of ram though physical is 16gb can u give me idea why? (4 Replies)
Discussion started by: manoj.solaris
4 Replies

8. Solaris

Swap config - Mirror swap or not?

Hello and thanks in advance. I have a Sun box with raid 1 on the O/S disks using solaris svm. I want to unmirror my swap partition, and add the slice on the second disk as an additional swap device. This would give me twice as much swap space. I have been warned not to do this by some... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

9. Solaris

RAM and SWAP confusion

Hi Folks, This is my first post here - so nice to meet u all :-) Recently i was trying to dig a little bit into the memory structure of my machine and due to the lack of concept, cannot figure out a calculation. This is how it goes: 1) My swap slice is at the usual /dev/dsk/c0t1d0s1... (0 Replies)
Discussion started by: s4g3
0 Replies

10. UNIX for Dummies Questions & Answers

Minimum RAM

Can anyone tell me the minimum ram requirements for suse 6.1 & mdk9 please? Will they accept edo ram? (3 Replies)
Discussion started by: onestepto
3 Replies
Login or Register to Ask a Question