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

Tomato OS: “memory exhausted” running vi … how to solve?

Discussion in 'Tomato Firmware' started by samjones3, Jul 10, 2012.

  1. samjones3

    samjones3 Serious Server Member

    I have set up tomato (shibby) on an asus RT-N66U router. It works great.
    I loaded up a few pieces, like transmission and optware.
    I can run vi, but when I run vi it fails with a "memory exhausted" error, and the terminal session hangs.
    For reference: If I simply start "vi" it runs fine. But if I specify vi <filename> I get the memory exhausted error, even if the file I am opening is just a couple of hundred bytes in size (like fstab).
    I discovered that my swap partition was not properly set up, so I did that. The swapon command now indicates I really do have a swap:
    Code:
    [root@MyRouter samba]$ swapon -s
    Filename Type Size Used Priority
    /dev/sda1 partition 32900860 0 1
    How can I get vi to work?
    Thanks!
    System setup reference information:
    • asus RT-N66U router
    • 2TB usb hard drive
    • partitions on hard drive:
      Code:
       Disk /dev/sda: 2000.4 GB, 2000398839808 bytes 255 heads, 63 sectors/track, 30400 cylinders Units = cylinders of 16065 * 4096 = 65802240 bytes Disk identifier: 0xfacbc8ab
      
      Device Boot Start End Blocks Id System 
      /dev/sda1 1 512 32900868 82 Linux swap / Solaris 
      /dev/sda2 513 29000 1830638880 83 Linux 
    • running samba
    • memory:
      $ cat /proc/meminfo
      MemTotal: 255840 kB
      MemFree: 210980 kB
      Buffers: 5264 kB
      Cached: 22768 kB
      SwapCached: 0 kB
      Active: 20272 kB
      Inactive: 11448 kB
      HighTotal: 131072 kB
      HighFree: 99868 kB
      LowTotal: 124768 kB
      LowFree: 111112 kB
      SwapTotal: 32900860 kB
      SwapFree: 32900860 kB
      Dirty: 0 kB
      Writeback: 0 kB
    TIA!
     
  2. jyavenard

    jyavenard Network Guru Member

    Sounds more like a bug in vi than an actual memory issue. For a router the n66 has a massive amount of ram. There's no need to use swap for it. You're only going to kill your flash
     
  3. samjones3

    samjones3 Serious Server Member

    What could I do / am I doing that will kill my flash?
     
  4. ppsun

    ppsun Networkin' Nut Member

    The only time I used vi, I successfully created a file over 3kb on jffs partition. Done on RT-N66U, version prior to shibby 87V-AIO.

    Current meminfo (shibby 95-AIO):
    MemTotal: 255840 kB
    MemFree: 220380 kB
    Buffers: 4400 kB
    Cached: 13188 kB
    SwapCached: 0 kB
    Active: 14196 kB
    Inactive: 10612 kB
    HighTotal: 131072 kB
    HighFree: 107100 kB
    LowTotal: 124768 kB
    LowFree: 113280 kB
    SwapTotal: 0 kB
    SwapFree: 0 kB
    Dirty: 0 kB
    Writeback: 0 kB

    No optware. Nvram: 4.5kB.
    Hope this info helps.
     
  5. jyavenard

    jyavenard Network Guru Member

    Sorry I thought you were using the jffs for swap.

    Many of the flash chip used in those router can do a maximum of 10,000 erase. So you definitely don't want to use them for swap. The less write, the better
     

Share This Page