LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-08-2009, 09:14 AM   #1
pgb205
Member
 
Registered: Nov 2007
Posts: 109

Rep: Reputation: 15
Order of memory usage in linux??


I'm not sure I understand the order in which memory is being used under linuxOS. We have cached memory, free memory and used memory.
'free' is not used by anything, 'cached' is stuff that OS loads in hopes of speeding up access in the future and 'used' is what's actively used right now. Let's say a new application is now requesting memory. Will OS first try to allocate memory from free pool or will it first try to get some space from the cached memory pool. In the latter case will it have to swap the data from cached memory pool to disk first or is it simply removed without being saved.

thanks
 
Old 06-08-2009, 09:24 AM   #2
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS6
Posts: 267

Rep: Reputation: 57
You are forgetting about the buffers. Linux saves I/O in buffers to combine disk IO and it is available for use almost immediately. First the stale buffers are used, then free, and if more is needed, some of the cache is swapped to swap. (so I think, which may not be the case)

Dave
 
Old 06-08-2009, 10:41 AM   #3
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Have a look at the 'swappiness' value too. Might help clear up some things.

http://lwn.net/Articles/83588/

Dave
 
  


Reply

Tags
cached, management, memory


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
top: order pids by memory instead of CPU usage dourk Linux - Newbie 8 10-17-2013 09:23 AM
X hangs after prolonged usage ... memory usage goes upto 195MB duryodhan Slackware 18 05-10-2007 06:16 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Linux Memory usage Boomba Linux - General 8 03-25-2004 04:16 PM


All times are GMT -5. The time now is 01:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration