LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2006, 06:55 AM   #1
Camino
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware
Posts: 22

Rep: Reputation: 15
Free Memory according to vmstat


Hello,

after booting linux and KDE,
`vmstat -s`
gives me the following info:

Code:
       246672  total memory
       239920  used memory
       199976  active memory
        25236  inactive memory
         6752  free memory
Now, 6752 as "free" memory is quite little. Question is, does that really reflect reality (as in the amount of memory that I really have available for my applications".

Otherwise I have something that eats a serious amount of resources.. :O
 
Old 02-27-2006, 07:10 AM   #2
madchaz
LQ Newbie
 
Registered: Feb 2006
Distribution: Gentoo
Posts: 5

Rep: Reputation: 0
The awnser is both yes and no.

vmstat -s gives you a realistic picture of memory usage, but doesn't tell you what is eating that memory. Chances are that a very large part of that used memory is buffer. Linux will use free memory as a buffer for hard drive acces.

This way, when you try and read or write to the hard drive, you don't have to wait quite as much. Linux will free the memory if it becomes needed for an application. If you want a more realistic view of your usage, try looking at top. This section will give you a more realistic view of the situation.

Code:
Mem:   2074952k total,  1140676k used,   934276k free,   128216k buffers
Swap:  5044400k total,        0k used,  5044400k free,   816884k cached
 
Old 02-27-2006, 07:11 AM   #3
Camino
LQ Newbie
 
Registered: Mar 2005
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 15
Actually, this made me see the "similiar threads" and they basically answer my question.

`free -m ` gives me 76mb with the cached.. Seems more reasonable.
 
Old 02-27-2006, 09:27 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Like any good virtul-memory operating system, Linux prefers for nearly-100% of the physical RAM to be doing something, all the time, even if it's only something that "might possibly" turn out to be useful. Something is, after all, better than nothing.

In the case of "buffers," for example ... when you read a file or load a program, Linux might read a whole lot of that file (or maybe all of it) into a buffer in virtual-memory. When the immediate use for that memory-buffer is done, Linux releases the buffer but does not immediately get rid of it. There's a fairly good chance that you'll be needing that file or that program again soon, and if that turns out to be the case, then by being "lazy" Linux has proved to be very efficient.

When, and indeed if, actual memory-pressure does develop, then Linux has a multi-tiered approach in dealing with it. It'll reduce the buffer-space, consuming that memory first, before moving on to more draconian measures like "serious swapping."

If you're concerned about whether memory is a problem, what you want to look for is processes being subjected to involuntary waits, due to swapping, for a significant amount or percentage of time. In other words, "is the situation actually slowing anybody down?" Mind you, a certain amount of swapping is normal... sometimes Linux "pre-loads" stuff into the swap-area.
 
  


Reply



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
How much memory is really 'free'? robbiemorgan Linux - Newbie 4 09-19-2004 07:05 PM
Free memory disappearing Vampyric Linux - General 2 02-17-2004 08:40 PM
free up unused memory im1crazyassmofo Linux - Hardware 1 01-20-2004 06:39 AM
Memory missing from 'free' simonburton Linux - General 3 11-19-2003 08:24 AM
Memory free problem edreddy Programming 1 11-09-2002 10:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration