Find the answer to your Linux question:
Results 1 to 3 of 3
from what i gather the kernel does memory mangagement, TCP/IP, and has all the drivers for hardware..it's basically for driving resources that applications use. but what is taking up all ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2004
    Posts
    7

    kernel size, memory used for what?


    from what i gather the kernel does memory mangagement, TCP/IP, and has all the drivers for hardware..it's basically for driving resources that applications use. but what is taking up all the RAM..i have 500 megs ram, and when i bootup into the black prompt and do a 'free -m' command, it tells me that i've used up about 120 megs of my ram.. why is this, as when i use TOP it says that hardly any % memory is being used? what is using up that 120 megs memory? the kernel is only 2 or so megs bz compressed..

    thx

  2. #2
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    Location
    South- or "Mid-" Sweden
    Posts
    742
    well, it's not just the kernel that runns, if you can type "free -m" you got at least one shell, which loads a few modules, then there's the sytems background services (for instance the system logger, which logs certain system events), if you got a printer you (probably) got CUPS (the printer subsystem), also, you get services to deal with the system local mail, networking, etc. Also, linux stores quite a good deal of disk data in memry as it's faster - it's called buffering and caching, it speeds up operations like continous read/writes to the same data file. (this is why one always must shutdown a linux system propperly - during shutdown all data is flushed to the disk (read: written to disk), worth pointing out is that the system automatically flushes the buffer and cahce at a certain interval (I think 5 seconds)). And there's something known as "memory mapped files", which, unless I'm misstaken, is files loaded to memory

    So it's probably the cache and buffer that allocates most of the memory, though usually when userland(or system/kernel) apps need memory adn teh ram is full, the cache and buffers are shrinked so that the memory becomes avalible to the application.

    You can see how much of the memory beeing used for buffer and cache in the columns "buffers" and "cached".
    Code:
    [15:31:22 frekla@ns1 ~]$ free -m
                 total       used       free     shared    buffers     cached
    Mem:           312        299         13          0          6         78
    -/+ buffers/cache:        213         98
    Swap:         2047        140       1907
    Regards Scienitca (registered user #335819 - http://counter.li.org )
    --
    A master is nothing more than a student who knows something of which he can teach to other students.

  3. #3
    Just Joined!
    Join Date
    Nov 2004
    Location
    Knoxville, TN
    Posts
    5

    Lots of Cache but no flushing

    Hi,

    A follow up question to this thread. I too have been wondering about similar memory usage (thanks for clearing up the mystery). However, it doesn't seem like the cached memory is ever flushed unless I logout. Is this 'normal'?

    Thanks.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •