Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Aug 2004 15:39:40 +0200 (MEST)
From:      Mipam <mipam@ibb.net>
To:        freebsd-questions@freebsd.org
Subject:   memory usage question
Message-ID:  <Pine.BSO.4.56.0408171524510.1777@ux11.ltcm.net>

next in thread | raw e-mail | index | archive | help
Hi,

I have a question about usage of memory.
Despite the well documented articles about it some things are still
unclear. In top we see memory devided in several items:

Active, inactive, buffered, wired and free.
The active memory is clear, it's what is in use by programs now.
Wired mem is also clear, it's for the kernel data structs.
When a program ends, the mem is put in the inactive part right?
So when the program is run 10 minutes after it can be started very 
quickly, also because the data used from the disk of that program is still 
in the cache part right? However, suppose the program isnt run in 2 hours, 
will there be a timeout in the parts which are being put in inactive and 
in cache? Suppose the timeout has occured, will the mem be added to free 
mem or? What is the difference between buffered mem and cached mem? Both 
represent data which is recently being called from the disk, so that next 
time when the file is called again, no disk access, needs to be made in 
order to save time right?

However, suppose i have little mem free, say 7 mb and still 200 in 
inactive. Then a program needs to start which needs say 30 mb on mem, will 
also mem be taken from the inactive part and discard the cache?
Some ppl only look at how much free mem is available on their system and 
then sound the alarm, however, shouldnt they add inactive and free 
together in order to see how much mem can be used for newly used programs 
(which didnt run before?).
Bye,

Mipam. 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSO.4.56.0408171524510.1777>