aspose file tools*
The moose likes Linux / UNIX and the fly likes utilization of swap memory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "utilization of swap memory" Watch "utilization of swap memory" New topic
Author

utilization of swap memory

Prashant Karmankar
Greenhorn

Joined: Jul 10, 2008
Posts: 24
Hi,
I am using RHEL5 on production environment, I have a query that how can i utilize swap memory even if i have adequate amount of physical memory free .

Prashant K
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16061
    
  21

Why would you want to? Swap memory is literally thousands of times slower than RAM. If you have enough physical RAM, nothing will swap in or out, and the effect would be the same as turning swapping off, minus a small overhead for the address-translation hardware.

Swapping is intended for when you don't have enough physical RAM, where the disk drive can substitute for RAM at an expense in speed, but in order to actually use this extra "memory", the data must be paged into physical RAM.


Customer surveys are for companies who didn't pay proper attention to begin with.
Prashant Karmankar
Greenhorn

Joined: Jul 10, 2008
Posts: 24
Thanks for reply, i have 4GB Physical RAM and 8 GB SWAP Memory installed on server running jboss application. when i execute the "top" or "free -m" command i found that system has very less physical memory free (15 MB) and swap memory utilization showing 0 percent. when i execute top command to find out which process is taking maximum memory i found that only jboss is taking 30% memory so which process is utilizing remaining memory and why top command can not show that process? When i restart the server and execute top / free -m command it show exact utilization of memory.

Prashant K
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Processes use memory on startup, and are kept in in the cache, so if you would need them again, they could be taken from there.

The memory isn't shown as free in top.
So the 30% doesn't mean there is something hidden - about 70% - nor does it mean swapping will start soon.


http://home.arcor.de/hirnstrom/bewerbung
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4655
    
    5

Swap memory is just disk space. It was useful back when systems had 32KB or so of RAM. Its useless now. Just ignore it.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

I wouldn't say it's useless. It's useful for hibernation/suspend to disk.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16061
    
  21

Historical note.

Way back when, I used to be a mainframe jockey. In the early 1980's, a "good" ration of RAM to paging storage was 1-to-8. Ever since about Linux 2.6, the recommended RAM-to-paging ratio has been 1-to-2.

Part of this is because Linux is more interactive than the old batch-heavy mainframe stuff, but part is also in how Linux uses VM.

And part, I'm sure, is because RAM is so cheap these days!
denis sorn
Ranch Hand

Joined: Apr 30, 2008
Posts: 33
With 'ps aux' you can have a better overview then with top on wich process uses how much memory.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: utilization of swap memory