1

I have little Linux system with 256MB RAM. I'm little bit confused, where the RAM may be lost? It is running old linux kernel 2.6.38 and I'm not able to ubgrade it (some specific ARM board).

SHM and all tmpfs mounted filesystems are almost empty shmem:448kB

Everyhing is consumed by active_anon pages but running processes does not correspond wih this. Sum of total_vm is just 90MB and there are duplicates, shared memory, unallocated memory... But active_anon is reported as 235MB. Why? How can I resolve this problem? Is there some memory leak in the kernel?

Here is relevant dmesg

    Mem-info:
    Normal per-cpu:
    CPU    0: hi:   90, btch:  15 usd:  14
    active_anon:60256 inactive_anon:67 isolated_anon:0
     active_file:0 inactive_file:185 isolated_file:0
     unevictable:0 dirty:0 writeback:0 unstable:0
     free:507 slab_reclaimable:120 slab_unreclaimable:463
     mapped:108 shmem:112 pagetables:217 bounce:0
    Normal free:2028kB min:2036kB low:2544kB high:3052kB active_anon:241024kB inactive_anon:268kB active_file:0kB inactive_file:740kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:260096kB mlocked:0k
    lowmem_reserve[]: 0 0
    Normal: 37*4kB 139*8kB 42*16kB 1*32kB 1*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 2028kB
    305 total pagecache pages
    65536 pages of RAM
    622 free pages
    1976 reserved pages
    404 slab pages
    393 pages shared
    0 pages swap cached
    [ pid ]   uid  tgid total_vm      rss cpu oom_adj oom_score_adj name
    [  713]     0   713      666       40   0       0             0 busybox
    [  719]     0   719      634       18   0       0             0 busybox
    [  725]     0   725      634       15   0       0             0 busybox
    [  740]     0   740      654       19   0       0             0 inetd
    [  752]     0   752      634       17   0       0             0 ifplugd
    [  761]     0   761      634       21   0       0             0 busybox
    [  790]     0   790     4297      110   0       0             0 app
    [  792]     0   792      635       15   0       0             0 getty
    [  812]     0   812      634       16   0       0             0 exe
    [  849]   101   849      630       57   0       0             0 lighttpd
    [  850]   101   850     3005      218   0       0             0 php-cgi
    [  851]   101   851     3005      218   0       0             0 php-cgi
    [ 3172]     0  3172    72156    59739   0       0             0 app
    [ 3193]     0  3193      675       23   0       0             0 ntpd
    [ 4003]     0  4003      634       15   0       0             0 ntpd_prog
    [ 4004]     0  4004      634       15   0       0             0 hwclock
    [ 4005]     0  4005      634       20   0       0             0 hwclock
    Out of memory: Kill process 3172 (app) score 912 or sacrifice child
    Killed process 3172 (app) total-vm:288624kB, anon-rss:238684kB, file-rss:272kB

Here is a list of mounted filesystems. Root filesystem is r/w YAFFS2 on MTD flash.

rootfs on / type rootfs (rw)
/dev/root on / type yaffs2 (rw,relatime)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
mdev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)
none on /proc/bus/usb type usbfs (rw,relatime)
none on /dev/pts type devpts (rw,relatime,mode=622)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
none on /tmp type tmpfs (rw,relatime,size=102400k,mode=777)
none on /run type tmpfs (rw,relatime,size=10240k,mode=755)
  • where is your root filesystem mounted from? – Murray Jensen Jun 22 '16 at 4:40
  • Root filesystem is r/w YAFFS2 on MTD flash. I have added all mounted filesystems to the question. – j123b567 Jun 23 '16 at 8:01
  • pretty sure active_anon includes tmpfs and you have a 100Mbyte tmpfs mounted on /tmp ... I'm guessing your/tmp is full - just because you can't see anything in there doesn't mean it isn't full - post df output – Murray Jensen Jun 23 '16 at 8:59
  • Problem is, that I don't have access to the particular system. I have just dmesg. I have another identical system. If I create big file in /tmp and compare output of /proc/meminfo before and after, only "Shmem" changes accordingly, "Active(anon)" is same. But yes, it was also my first thought. I must gain access to the system to be sure, but I need some tips what to search. – j123b567 Jun 23 '16 at 9:12
  • read this and this - use the commands df /tmp/, df /run/, df /dev/ and df /dev/shm/ – Murray Jensen Jun 23 '16 at 13:46
2

Total_vm was badly calculated by me and the OOM report is correct. app has allocated 59739 pages which is 233MB. So, this is the correct reason of OOM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.