AnsweredAssumed Answered

Memory usage and XIP in ram fs

Question asked by illishar on Aug 26, 2014
Latest reply on Aug 27, 2014 by illishar

I have some allocation issues on my bf516 system and I'm pondering my memory.

 

I have a standard setup with uboot, kernel 3.10 etc.

 

Here's the output of my meminfo + top:

 

MemTotal:          29288 kB
MemFree:            6436 kB
Buffers:            2988 kB
Cached:             8664 kB
SwapCached:            0 kB
Active:             3428 kB
Inactive:           3356 kB
Active(anon):          0 kB
Inactive(anon):        0 kB
Active(file):       3428 kB
Inactive(file):     3356 kB
Unevictable:        4864 kB
Mlocked:               0 kB
MmapCopy:           5064 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                36 kB
Writeback:             0 kB
AnonPages:             0 kB
Mapped:                0 kB
Shmem:                 0 kB
Slab:               5756 kB
SReclaimable:       4208 kB
SUnreclaim:         1548 kB
KernelStack:         280 kB
PageTables:            0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:       14644 kB
Committed_AS:          0 kB
VmallocTotal:          0 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB

 

Mem: 22856K used, 6432K free, 0K shrd, 2988K buff, 8660K cached
CPU:   0% usr   8% sys   0% nic  91% idle   0% io   0% irq   0% sirq
Load average: 0.16 0.08 0.06 1/35 4246
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 4246   211 root     R      820   3%   8% top
  215     1 root     S     1064   4%   0% /bin/opcd
  211     1 root     S      844   3%   0% -/bin/sh
  212     1 root     S      816   3%   0% /bin/inetd -f
  219     1 root     S      816   3%   0% /bin/udhcpc -Sf
  180     1 root     S      812   3%   0% /sbin/klogd -n
  218     1 root     S      708   2%   0% /bin/data_logger
  217     1 root     S      600   2%   0% /bin/etherbridge
    1     0 root     S      568   2%   0% /init
  268     1 nobody   S      500   2%   0% /bin/netbiosd
  209     1 root     S      496   2%   0% watchdog
  267     1 root     S      488   2%   0% /bin/slp_discoveryd
  179     1 root     S      468   2%   0% /sbin/syslogd -n -S -s 12 -b 8
  158     2 root     SW       0   0%   0% [mmcqd/0]
    3     2 root     SW       0   0%   0% [ksoftirqd/0]
   89     2 root     SW       0   0%   0% [kworker/0:1]
   95     2 root     SW       0   0%   0% [kswapd0]
  186     2 root     SWN      0   0%   0% [jffs2_gcd_mtd3]
 3428     2 root     SW       0   0%   0% [kworker/u2:0]
 4224   218 root     Z        0   0%   0% [dropbox]

 

First thing: I have a 32M sdram block. Why is it only showing a total of 29M? The last 2M is kernel/uboot?

 

The whole fs has been loaded into ram. This is shown by the "Slab" value.

 

The "MmapCopy" value display the application ram usage, minus buffers. Eg. "MmapCopy" + "Buffer" = Sum(apps).

 

It seems that the applications are loaded twice. The apps are placed in the ram fs *and* they're loaded into ram when executed. It seems somewhat wasteful? Isn't there a way to execute the applications in place or something? (XIP)

Outcomes