How does disk/memory work on Linpus Linux

Discussion in 'Linux' started by spiridenok, Jun 30, 2009.

  1. spiridenok

    spiridenok

    Joined:
    Jun 7, 2009
    Messages:
    6
    Likes Received:
    0
    Hello all,

    I dont really understand how the disk and memory management works on Linpus Linux.

    To illustrate the situation i use the following:
    - System Monitor application->Resources Tab->Memory and Swap History
    - hard disk access indicator (2nd led on the top-left corner of AAO)

    While i'm running applications like Firefox and/or Vuze i look both at the HDD access led and at the Memory and Swap History. What i see is:
    - User Memory: always stays around 500MiB of 1000Mib
    - Used swap: always stays around 50Kib of 1Gib
    - HDD access indicator: very often goes on (probably means something is read from or written to the HDD) and sometimes stays on for several seconds (depending which page i open in Firefox for example)!

    So i dont understand at all how the memory/HDD management works on Linux.

    I would assume that first the RAM is filled in with all kind of data that the applications need (like Firefox plugins, jvm stuff for Vuze etc.), then i would assume that the swap is completely filled if the amount of data is larger than the available RAM. And only after swap is completely filled in, i would expect HDD to be used pretty often and for a long time (for example for swapping data or reading new data from disk).

    What i see is completely different from my undertanding of the whole system. It looks more like the memory usage is limited to 512MiB and swap is not used at all.Every library (like Firefox plugin) is loaded from HDD every time it's needed.

    Because memory/swap/hdd management is normally the responsibility of the OS (Linux in this case) i assume it's something in the Linux configuration. Because other Linux i've seen does not have this issue, i assume this is the Linpus configuration question.

    So, any explanations for this situation would be welcome! Also if somebody knows how to make my linux use more RAM and less HDD - please let me know. Because of that problem i can hardly browser Internet wihtout long delays in opening pages.
     
    spiridenok, Jun 30, 2009
    #1
  2. spiridenok

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Your swap occupies its own swap partition on the SSD drive. So if swap is used, indeed the system is writing/reading from your drive.

    Cheers.
     
    rbil, Jul 1, 2009
    #2
  3. spiridenok

    spiridenok

    Joined:
    Jun 7, 2009
    Messages:
    6
    Likes Received:
    0
    Indeed , if the swap is used, the system could use my hdd pretty heavy. However if i look at the System Monitor->Used Swap it show that max 44 KiB is used. So it looks like Linux does not use swap at all. Also RAM is used for max 500MiB.

    What is the point then in having 1GB of swap and 1GB of RAM if Linux does not use them?
    How to make it use all the available resourses and not just the HDD?
     
    spiridenok, Jul 1, 2009
    #3
  4. spiridenok

    fweigel

    Joined:
    Oct 24, 2008
    Messages:
    118
    Likes Received:
    0
    Open a terminal (ALT-F2 "terminal"), and then issue the command

    top

    This will bring up a text-based monitor. Check the top lines:

    top - 20:32:40 up 11:30, 2 users, load average: 1.77, 1.18, 0.76
    Tasks: 146 total, 3 running, 142 sleeping, 0 stopped, 1 zombie
    Cpu(s): 12.7%us, 4.8%sy, 0.0%ni, 80.7%id, 1.0%wa, 0.0%hi, 0.8%si, 0.0%st
    Mem: 504732k total, 459124k used, 45608k free, 1812k buffers
    Swap: 1052248k total, 58844k used, 993404k free, 111376k cached

    This is from my system: a 512MB Aspire One. Note that 459MB of memory is in use (second figure in Mem: row), and 59MB of swap (second figure in Swap: row).

    top will continue to update every 5 seconds. To exit, press the "q" key (for quit).

    Now, on this machine, I am running Firefox (to browse this site), Transmission (a bittorrent client), I have a terminal open (to copy the "top" result from), and was just playing a video (Videos folder is open). As you can see by the Tasks: total, I am running a few other programs as well (146 tasks):

    festival - a text to speech utility
    acerfand - to control fan speed
    rpcbind and nfslock - for network shares
    autofs - to automatically manage other mounts, including my crypto mounts
    ntpd - to automatically synchronize my clock
    postgresql - a popular full-feature SQL server
    privoxy & tor - anonymous browsing proxy
    vtl - a virtual tape library (robotic tape handler replacement)

    Plus, I use Evolution as my mail client which also does calendaring, and runs some background stuff as well.

    With a 1GB memory system, you can, of course, do more. Firefox may occasionally be memory hungry (if opening enough tabs, for instance). But, it is likely that you haven't stressed the system enough to see any effect!

    Open more! Your result isn't surprising yet.
     
    fweigel, Jul 3, 2009
    #4
  5. spiridenok

    fweigel

    Joined:
    Oct 24, 2008
    Messages:
    118
    Likes Received:
    0
    As a PS - I am assuming that you have "upgraded" Firefox to version 3? If so, the long delays are caused by sqlite. To fix this, the sqlite databases can be vacuumed and compacted.

    If you need help with this (and this is indeed the case), post, and I can supply instructions...
     
    fweigel, Jul 3, 2009
    #5
  6. spiridenok

    DutchDK

    Joined:
    Jun 2, 2009
    Messages:
    338
    Likes Received:
    0
    Location:
    Copenhagen
    Just on a sidenote - If you don't need the client-server facilities of Festival, you should use the flite runtime instead. Less systemressources needed and less cpu cycles used. I changed from festival to flite of that particular reason for my kismet wardriving setup on the AAO.

    As for the Acerfand script, change over to the acerhdf kernel module. If you are running Ubuntu, its available as a DKMS module, which gets compiled automatically for the kernels you are using. You can ofcourse also compile it manually from the tarball at piie.net. With the acerfand script which lives in user land, you can run into a race condition with the kernel. If you use the acerhdf module instead, you have the same functionality, and it cooperates with the kernel.
     
    DutchDK, Jul 3, 2009
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.