[ncolug] Re: perspective: memory usage

  • From: Mike <mike@xxxxxxxxxxxxxxxx>
  • To: ncolug@xxxxxxxxxxxxx
  • Date: Tue, 09 Jan 2007 11:50:05 -0500

Chuck Stickelman wrote:
> larry wrote:
> 
>> No, I am not aware of "several ways" to use it.
>>
>> No, I haven't seen it use that much before. As a matter of fact, right
>> now it is down to 854MB. I would say that, up until now, it tended to
>> stay around 600. I just assumed that, as with other OS's that shall
>> remain nameless, as you update it, memory usage creeps upward.
>>
> Not really.  The kernel's size is all controlled by the specific modules
> installed.  When compiled, the kernel's core isn't all that big.  Even
> when loaded into RAM the kernel itself is measured in a few MegaBytes at
> most.  As you get more modules installed, the amount used increases. 
> The kernel and it's modules make up one of Mike's "ways" we can use
> memory.  Note that many of the programming APIs are built such that most
> of the memory pages are static and can be mapped easily in a Virtual
> Memory system such as Linux.  This means that having multiple instances
> of a specific executable doesn't waste RAM; each instance uses the
> static information in a shared manner and only the pages needed by a
> specific process needs to be duplicated.
> 
> The next way memory can be used is for user-space processes (a.k.a.
> programs and/or applications).  These need overhead for managing the
> processes, plus the executable and the related data.  Again, when these
> processes utilize shared libraries, their actual RAM footprint is small.
> 
> Other ways RAM can be used are disk cache and buffers.  When we read
> data from a storage device we can make some predictive guesses as to
> where we are going to read from in the near future, we use a dynamic
> disk cache for this.  Linus will allocate as much RAM as it needs for
> cache; if total available memory is reduced beyond some threshold Linux
> will purge some cache pages.  Very dynamic, very much worth the slight
> CPU load that true Virtual Memory systems require...  Disk buffers store
> FileSystem data that has not been committed to permanent storage.  Again
> this administration takes a slight bit of RAM and CPU, but it allows
> processes to go their way rapidly.  Having dirty buffers means that
> there are buffers with unwritten data, and can be the source of data
> loss and filesystem corruption should the Linux system stop.
> 
> Linux is now also capable of using RAM as a /tmp filesystem.  I guess
> that'd be another way we could use memory.
> 
> Chuck

Have yet to find a decent link that explains what I meant by "using"
memory in different ways well.  It appears to be a compiled in option of
the kernel.  The option controls how much memory is reserved for the
kernel and userspace.  1/3 seems to be the most used.  In the simple
view again this means 1GB is only for the kernel and the pages it's
using.  The remaining 3GB is available to userspace.


-- 
Mike

http://www.bellyacresoh.com

To unsubscribe send to ncolug-request@xxxxxxxxxxxxx with 'unsubscribe' in the 
Subject field.

Other related posts: