• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

utilization of swap memory

 
Prashant Karmankar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Prashant Karmankar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't say it's useless. It's useful for hibernation/suspend to disk.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With 'ps aux' you can have a better overview then with top on wich process uses how much memory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic