linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Interpreting /proc/meminfo. How much free memory do I have?
@ 2006-03-27  6:49 antonio.dibacco
  2006-03-27  7:53 ` Roger Larsson
  0 siblings, 1 reply; 5+ messages in thread
From: antonio.dibacco @ 2006-03-27  6:49 UTC (permalink / raw)
  To: linuxppc-embedded


Hi, 

I'm a little bit puzzled with the fields in /proc/meminfo. Which fields have 
I to sum up to get the amount of free memory? 

Thank you,
Antonio.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Interpreting /proc/meminfo. How much free memory do I have?
  2006-03-27  6:49 Interpreting /proc/meminfo. How much free memory do I have? antonio.dibacco
@ 2006-03-27  7:53 ` Roger Larsson
  2006-03-27  9:00   ` Eberhard Stoll
  0 siblings, 1 reply; 5+ messages in thread
From: Roger Larsson @ 2006-03-27  7:53 UTC (permalink / raw)
  To: linuxppc-embedded

On m=E5ndag 27 mars 2006 08.49, antonio.dibacco wrote:
> Hi,
>
> I'm a little bit puzzled with the fields in /proc/meminfo. Which fields
> have I to sum up to get the amount of free memory?

=46rom a 2.6 /proc/meminfo

MemTotal:       515532 kB
MemFree:          6012 kB
Buffers:         79964 kB
Cached:          83264 kB
SwapCached:      82840 kB
Active:         294024 kB
Inactive:       130304 kB
=2D - -

Completely free is only MemFree. But those pages are only needed for
interrupt handlers (close enough).

Cached pages are also free but since they contain data that maybe will
be needed again (unmodified data that already is on disk) they are not
returned to MemFree state.

Inactive pages has not been in use for awhile and can be written out
if needed (some are probably unmodified and quick to get)

/RogerL

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Interpreting /proc/meminfo. How much free memory do I have?
  2006-03-27  7:53 ` Roger Larsson
@ 2006-03-27  9:00   ` Eberhard Stoll
  2006-03-27  9:38     ` antonio.dibacco
  0 siblings, 1 reply; 5+ messages in thread
From: Eberhard Stoll @ 2006-03-27  9:00 UTC (permalink / raw)
  To: linuxppc-embedded

Roger Larsson schrieb:

>On måndag 27 mars 2006 08.49, antonio.dibacco wrote:
>  
>
>>Hi,
>>
>>I'm a little bit puzzled with the fields in /proc/meminfo. Which fields
>>have I to sum up to get the amount of free memory?
>>    
>>
>
>>From a 2.6 /proc/meminfo
>
>MemTotal:       515532 kB
>MemFree:          6012 kB
>Buffers:         79964 kB
>Cached:          83264 kB
>SwapCached:      82840 kB
>Active:         294024 kB
>Inactive:       130304 kB
>- - -
>
>Completely free is only MemFree. But those pages are only needed for
>interrupt handlers (close enough).
>
>Cached pages are also free but since they contain data that maybe will
>be needed again (unmodified data that already is on disk) they are not
>returned to MemFree state.
>
>Inactive pages has not been in use for awhile and can be written out
>if needed (some are probably unmodified and quick to get)
>  
>
Active + Inactive + MemFree is not equal MemTotal. Where can i find the
offset?

Thanks,
Eberhard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Interpreting /proc/meminfo. How much free memory do I have?
  2006-03-27  9:00   ` Eberhard Stoll
@ 2006-03-27  9:38     ` antonio.dibacco
  2006-03-27 16:49       ` Jeff Angielski
  0 siblings, 1 reply; 5+ messages in thread
From: antonio.dibacco @ 2006-03-27  9:38 UTC (permalink / raw)
  To: linuxppc-embedded

I don't understand the meaning of "Inactive". They are not used but the 
kernel cannot give this memory to a requesting process because we tipically 
don't have a swap device on a linux embedded board. Where we can store the 
Inactive page? Am I wrong?
If I run a process that continuosly allocates memory and print out the total 
allocated memory when it receives SIGINT or SIGTERM, I think I get the real 
"free memory"! 

Bye,
Antonio. 

Eberhard Stoll Scrive: 

> Roger Larsson schrieb: 
> 
>>On måndag 27 mars 2006 08.49, antonio.dibacco wrote:
>>   
>>
>>>Hi, 
>>>
>>>I'm a little bit puzzled with the fields in /proc/meminfo. Which fields
>>>have I to sum up to get the amount of free memory?
>>>     
>>>
>>
>>>From a 2.6 /proc/meminfo
>>
>>MemTotal:       515532 kB
>>MemFree:          6012 kB
>>Buffers:         79964 kB
>>Cached:          83264 kB
>>SwapCached:      82840 kB
>>Active:         294024 kB
>>Inactive:       130304 kB
>>- - - 
>>
>>Completely free is only MemFree. But those pages are only needed for
>>interrupt handlers (close enough). 
>>
>>Cached pages are also free but since they contain data that maybe will
>>be needed again (unmodified data that already is on disk) they are not
>>returned to MemFree state. 
>>
>>Inactive pages has not been in use for awhile and can be written out
>>if needed (some are probably unmodified and quick to get)
>>   
>>
> Active + Inactive + MemFree is not equal MemTotal. Where can i find the
> offset? 
> 
> Thanks,
> Eberhard 
> 
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Interpreting /proc/meminfo. How much free memory do I have?
  2006-03-27  9:38     ` antonio.dibacco
@ 2006-03-27 16:49       ` Jeff Angielski
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Angielski @ 2006-03-27 16:49 UTC (permalink / raw)
  To: antonio.dibacco; +Cc: linuxppc-embedded

On Mon, 2006-03-27 at 09:38 +0000, antonio.dibacco wrote:
> I don't understand the meaning of "Inactive". They are not used but the 
> kernel cannot give this memory to a requesting process because we tipically 
> don't have a swap device on a linux embedded board. Where we can store the 
> Inactive page? Am I wrong?
> If I run a process that continuosly allocates memory and print out the total 
> allocated memory when it receives SIGINT or SIGTERM, I think I get the real 
> "free memory"! 

The "big picture" is that the kernel assumes that any physical memory
that is not used is being wasted.  The kernel tries to anticipate what
data you will need and loads it into memory before you actually require
it.  This way there is no time delay when you want to access it.  So the
numbers are reflecting what the system/kernel is currentl using.  

Even if you are on a system with no swap parition like your embedded
board, pages in memory that are read-only can still be swapped out since
they can always be read back in when needed.  Sections like a
processes .text fit this category.

If you are trying to look at a specific process, perhaps looking at
the /proc/<pid>/status might help you analyze your memory needs.


Jeff Angielski
The PTR Group

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-03-27 16:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-27  6:49 Interpreting /proc/meminfo. How much free memory do I have? antonio.dibacco
2006-03-27  7:53 ` Roger Larsson
2006-03-27  9:00   ` Eberhard Stoll
2006-03-27  9:38     ` antonio.dibacco
2006-03-27 16:49       ` Jeff Angielski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).