1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

memory vanising in to thin air

Discussion in 'Tomato Firmware' started by CodeMonkey.NET, Dec 27, 2007.

  1. CodeMonkey.NET

    CodeMonkey.NET LI Guru Member

    Hi all

    Perhaps someone can help me answer this question. I'm running Tomato v1.07 on WRT54GL v1.1, after a fresh reboot the status page says that there is roughly 6MB free memory, but after only one day it's down to ~2.2MB. Cached memory size has only increased approx 0.3MB during that time. So where is the memory going? No one on the network is using P2P, and from using conntrack regularly, I'm fairly confident that the amount of simultaneously open connections is never above 600 and most of the time below 300.

    On a side note, is there a command you can type when connected to the router via ssh, to make it clear the cached memory.

    Any help is much appreciated.
     
  2. Slavedriver

    Slavedriver LI Guru Member

  3. CodeMonkey.NET

    CodeMonkey.NET LI Guru Member

    I have a firewall script to do some simple QoS, based on ip's, some static DHCP rules. ,other than that is its pretty much default.
     
  4. Slavedriver

    Slavedriver LI Guru Member

    Check if you don't have multiple instances of your firewall scripts running. Although I do find it strange you you have whole 6Mb free in the first place. My GL v1.1 with Tomato v1.13 has 1Mb free.
     
  5. Toxic

    Toxic Administrator Staff Member

    is the memory being used by the realtime bandwidth monitoring and logging?
     
  6. Slavedriver

    Slavedriver LI Guru Member

    As far as I can see bandwidth monitoring uses almost 0 memory even if you save it to RAM on hourly basis. When you have real-time monitoring I also see no change in used RAM.
    Logging, in fact, can use a chunk of memory but there's a log filesize limit imposed so I highly doubt it'll take as much as 4Mb.
    My router's memory is mostly eaten up by dnsmasq but that's understandable seeing that I have hosts file loaded.
    I can just assume that it's QoS. But anyway could you please post top command output here ? SSH into your router and type "top" minus "".
     
  7. HennieM

    HennieM Network Guru Member

    The "free" command does not show cached mem (it's shown as part of "used" mem). That is more likely where your mem is going. As I understand it, cached mem holds code that have been executed, and is called upon if the same code is executed again.

    More can be seen with
    Code:
    cat /proc/meminfo
    This guy seems to have a slightly different explanation: http://sourcefrog.net/weblog/software/linux-kernel/free-mem.html

    Whatever the case, cached and buffered mem reduces free mem, but that mem is not lost to free mem, and can be made "free" if need be. It's just used to speed up code execution and disk I/O "because it's there", and will be released if mem is required for different code for example - no need to explicitly "flush" or "clear" the buffers/cache.

    Therefore, Total Free RAM = Free + cached + buffered

    You might ask why buffer disk IO as routers run off flash disks. RAM is still way faster than flash
    If a machine has less RAM than another machine, and both machines do exactly the same disk IO and run the same programs, less will be cached/buffered in the "less RAM" machine, resulting in more disk and code IO, but the programs will still run.
     

Share This Page