Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 06-08-2009, 10:14 AM   #1
Registered: Nov 2007
Posts: 124

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.

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

Rep: Reputation: 58
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)

Old 06-08-2009, 11:41 AM   #3
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.



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 10:23 AM
X hangs after prolonged usage ... memory usage goes upto 195MB duryodhan Slackware 18 05-10-2007 07:16 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 09: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 05:45 AM
Linux Memory usage Boomba Linux - General 8 03-25-2004 05:16 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:43 AM.

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