2012-08-07 57 views
2

我有一個基於ARM的嵌入式系統。我只是提出了內核(2.6.34)。以下是一些命令輸出。我無法解釋整個RAM(128 M)。嵌入式系統:我的記憶在哪裏?

內核似乎正在使用128 MB - 124368 kB = 6704 kB。

Cache = 1672 kB 
Slab = 3000 kB 

但MemFree僅爲100812 kB。我如何解釋其餘的內存(大約18.5 MB)?

另外,1512 kB的Committed_AS值是什麼意思?

# cat /proc/meminfo 
MemTotal:   124368 kB 
MemFree:   100812 kB 
Buffers:    0 kB 
Cached:    1672 kB 
SwapCached:   0 kB 
Active:    1692 kB 
Inactive:   284 kB 
Active(anon):  304 kB 
Inactive(anon):  0 kB 
Active(file):  1388 kB 
Inactive(file):  284 kB 
Unevictable:   0 kB 
Mlocked:    0 kB 
SwapTotal:    0 kB 
SwapFree:    0 kB 
Dirty:     4 kB 
Writeback:    0 kB 
AnonPages:   328 kB 
Mapped:    856 kB 
Shmem:     0 kB 
Slab:    3000 kB 
SReclaimable:  1116 kB 
SUnreclaim:   1884 kB 
KernelStack:   248 kB 
PageTables:   48 kB 
NFS_Unstable:   0 kB 
Bounce:    0 kB 
WritebackTmp:   0 kB 
CommitLimit:  62184 kB 
Committed_AS:  1512 kB 
VmallocTotal:  876544 kB 
VmallocUsed:  1848 kB 
VmallocChunk:  873908 kB 



# free 
      total   used   free  shared  buffers 
Mem:  124368  23584  100784   0   0 
-/+ buffers:    23584  100784 
Swap:   0   0   0 



# lsmod 
Module     Size Used by Not tainted 



# ps 
    PID USER  VSZ STAT COMMAND 
    1 0   1556 S init 
    2 0   0 SW [kthreadd] 
    3 0   0 SW [ksoftirqd/0] 
    4 0   0 SW [watchdog/0] 
    5 0   0 SW [events/0] 
    6 0   0 SW [khelper] 
    10 0   0 SW [async/mgr] 
    200 0   0 SW [sync_supers] 
    202 0   0 SW [bdi-default] 
    203 0   0 SW [kblockd/0] 
    209 0   0 SW [ata/0] 
    210 0   0 SW [ata_aux] 
    211 0   0 SW [pxa2xx-spi.2] 
    218 0   0 SW [khubd] 
    221 0   0 SW [kseriod] 
    234 0   0 SW [kmmcd] 
    253 0   0 SW [rpciod/0] 
    261 0   0 SW [khungtaskd] 
    262 0   0 SW [kswapd0] 
    264 0   0 SW [aio/0] 
    265 0   0 SW [nfsiod] 
    267 0   0 SW [crypto/0] 
    414 0   0 SW [mtdblockd] 
    457 0   0 SW [ubi_bgt0d] 
    537 0   0 SW [usbhid_resumer] 
    563 0   0 SW [ubifs_bgt0_0] 
    581 0   1556 S telnetd -l /bin/sh 
    586 0   1948 S < udevd -d 
2956 0   1560 S -/bin/sh 
3986 0   0 SW [flush-ubifs_0_0] 
3990 0   4216 R ps 
+0

MemFree是要告訴你是不是當前所使用的內存。所有的磁盤讀取都將被緩存,並且該緩存將從MemFree中減去;儘管如果需要的話它仍然可以用於比讀取緩存更重要的事情。另外'/ proc/iomem'應該告訴你哪些內存地址映射到哪裏,如果你認爲你缺少內存,你可以使用它來查找哪些地址用於RAM。 HTH – tMC 2012-08-07 19:23:19

+0

感謝您的回覆。我已經考慮過1672 kB的緩存。/proc/iomem僅指示落入系統RAM範圍內的內核文本(5011 kB)和內核數據(394 kB)區域。其他範圍在系統RAM範圍之外。 – numis 2012-08-08 03:50:16

回答

1

(這是長評論)

Committed_AS: An estimate of how much RAM you would need to make a 
       99.99% guarantee that there never is OOM (out of memory) 
       for this workload. Normally the kernel will overcommit 
       memory. That means, say you do a 1GB malloc, nothing 
       happens, really. Only when you start USING that malloc 
       memory you will get real memory on demand, and just as 
       much as you use. So you sort of take a mortgage and hope 
       the bank doesn't go bust. Other cases might include when 
       you mmap a file that's shared only when you write to it 
       and you get a private copy of that data. While it normally 
       is shared between processes. The Committed_AS is a 
       guesstimate of how much RAM/swap you would need 
       worst-case. 

http://lwn.net/Articles/28345/