Hi,
I checked today the memory usage of:
Linux version 3.7.2-2-ARCH (nobody@panda2) (gcc version 4.7.2 (GCC) ) #1 PREEMPT Thu Jan 17 07:51:19 UTC 2013
[root@olinuxino ~]# cat /proc/meminfo
MemTotal: 52436 kB
MemFree: 2832 kB
Buffers: 11924 kB
Cached: 13184 kB
SwapCached: 0 kB
Active: 18816 kB
Inactive: 10660 kB
Active(anon): 4404 kB
Inactive(anon): 112 kB
Active(file): 14412 kB
Inactive(file): 10548 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 4 kB
Writeback: 0 kB
AnonPages: 4384 kB
Mapped: 7204 kB
Shmem: 148 kB
Slab: 18284 kB
SReclaimable: 14972 kB
SUnreclaim: 3312 kB
KernelStack: 368 kB
PageTables: 392 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 26216 kB
Committed_AS: 9928 kB
VmallocTotal: 958464 kB
VmallocUsed: 2424 kB
VmallocChunk: 777880 kB
[root@olinuxino ~]# ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 4.6 4600 2464 ? Ss 09:18 0:03 /sbin/init
root 2 0.0 0.0 0 0 ? S 09:18 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 09:18 0:00 [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S< 09:18 0:00 [kworker/0:0H]
root 6 0.0 0.0 0 0 ? S 09:18 0:00 [kworker/u:0]
root 7 0.0 0.0 0 0 ? S< 09:18 0:00 [kworker/u:0H]
root 8 0.0 0.0 0 0 ? S 09:18 0:00 [watchdog/0]
root 9 0.0 0.0 0 0 ? S< 09:18 0:00 [cpuset]
root 10 0.0 0.0 0 0 ? S< 09:18 0:00 [khelper]
root 11 0.0 0.0 0 0 ? S 09:18 0:00 [kdevtmpfs]
root 12 0.0 0.0 0 0 ? S< 09:18 0:00 [netns]
root 222 0.0 0.0 0 0 ? S 09:18 0:00 [bdi-default]
root 223 0.0 0.0 0 0 ? S< 09:18 0:00 [kintegrityd]
root 225 0.0 0.0 0 0 ? S< 09:18 0:00 [kblockd]
root 272 0.0 0.0 0 0 ? S 09:18 0:00 [khubd]
root 369 0.0 0.0 0 0 ? S< 09:18 0:00 [rpciod]
root 370 0.0 0.0 0 0 ? S 09:18 0:00 [kworker/0:1]
root 376 0.0 0.0 0 0 ? S 09:18 0:00 [khungtaskd]
root 380 0.0 0.0 0 0 ? S 09:18 0:00 [kswapd0]
root 437 0.0 0.0 0 0 ? S 09:18 0:00 [fsnotify_mark]
root 453 0.0 0.0 0 0 ? S< 09:18 0:00 [nfsiod]
root 465 0.0 0.0 0 0 ? S< 09:18 0:00 [crypto]
root 509 0.0 0.0 0 0 ? S< 09:18 0:00 [iscsi_eh]
root 522 0.0 0.0 0 0 ? S 09:18 0:00 [spi32766]
root 555 0.0 0.0 0 0 ? S< 09:18 0:00 [ci_otg]
root 566 0.0 0.0 0 0 ? S 09:18 0:00 [kworker/u:2]
root 582 0.0 0.0 0 0 ? S 09:18 0:01 [mmcqd/0]
root 600 0.0 0.0 0 0 ? S< 09:18 0:00 [deferwq]
root 607 0.0 0.0 0 0 ? S 09:18 0:00 [jbd2/mmcblk0p2-]
root 608 0.0 0.0 0 0 ? S< 09:18 0:00 [ext4-dio-unwrit]
root 620 0.0 2.4 9100 1288 ? Ss 09:18 0:01 /usr/lib/systemd/systemd-udevd
root 624 0.0 9.9 36728 5200 ? Ss 09:18 0:03 /usr/lib/systemd/systemd-journald
root 628 0.0 0.0 0 0 ? S 09:18 0:00 [kworker/0:2]
root 794 0.0 2.3 4804 1240 ? Ss 09:18 0:00 /usr/sbin/crond -n
root 804 0.0 4.2 6272 2228 ? Ss 09:18 0:00 /usr/sbin/sshd -D
root 815 0.0 2.4 3108 1304 ? Ss 09:18 0:00 /usr/lib/systemd/systemd-logind
dbus 821 0.0 2.4 2692 1296 ? Ss 09:18 0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root 838 0.0 5.6 7040 2940 ? Ss 09:18 0:01 /usr/sbin/syslog-ng -F
root 951 0.0 1.3 3780 688 tty1 Ss+ 09:18 0:00 /sbin/agetty --noclear tty1 38400 linux
root 1021 0.0 3.2 5912 1716 ? Ss 09:19 0:00 login -- root
root 1085 0.0 0.9 1916 488 ? Ss 09:19 0:00 dhcpcd -qL -t 10 eth0
ntp 1092 0.0 1.8 3480 948 ? S 09:19 0:00 /usr/sbin/ntpd -s
root 1093 0.0 1.2 3648 640 ? Ss 09:19 0:00 /usr/sbin/ntpd -s
root 1097 0.0 3.5 5336 1856 ttyAMA0 Ss 09:30 0:00 -bash
root 1132 0.0 0.0 0 0 ? S 11:26 0:00 [flush-179:0]
root 1137 0.0 2.2 4816 1168 ttyAMA0 R+ 11:38 0:00 ps -aux
Is it just me or base system ram usage is a bit high ?
I get 54808 kB memtotal with a modular linux 3.7.5, so more or less the same.
root@aileen:~# cat /proc/meminfo
MemTotal: 54808 kB
MemFree: 1628 kB
Buffers: 11772 kB
Cached: 20748 kB
SwapCached: 0 kB
Active: 18764 kB
Inactive: 19152 kB
Active(anon): 3564 kB
Inactive(anon): 3752 kB
Active(file): 15200 kB
Inactive(file): 15400 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 32764 kB
SwapFree: 32764 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 5404 kB
Mapped: 5732 kB
Shmem: 1928 kB
Slab: 10708 kB
SReclaimable: 6616 kB
SUnreclaim: 4092 kB
KernelStack: 552 kB
PageTables: 600 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 60168 kB
Committed_AS: 17900 kB
VmallocTotal: 958464 kB
VmallocUsed: 2672 kB
VmallocChunk: 751340 kB
root@aileen:~# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.1 1.1 1776 628 ? Ss 11:08 0:02 init [3]
root 2 0.0 0.0 0 0 ? S 11:08 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 11:08 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S 11:08 0:00 [kworker/0:0]
root 5 0.0 0.0 0 0 ? S< 11:08 0:00 [kworker/0:0H]
root 6 0.0 0.0 0 0 ? S 11:08 0:00 [kworker/u:0]
root 7 0.0 0.0 0 0 ? S< 11:08 0:00 [kworker/u:0H]
root 8 0.0 0.0 0 0 ? S 11:08 0:00 [watchdog/0]
root 9 0.0 0.0 0 0 ? S< 11:08 0:00 [khelper]
root 10 0.0 0.0 0 0 ? S 11:08 0:00 [kdevtmpfs]
root 11 0.0 0.0 0 0 ? S 11:08 0:00 [bdi-default]
root 12 0.0 0.0 0 0 ? S< 11:08 0:00 [kintegrityd]
root 13 0.0 0.0 0 0 ? S< 11:08 0:00 [kblockd]
root 14 0.0 0.0 0 0 ? S 11:08 0:00 [khubd]
root 15 0.0 0.0 0 0 ? S< 11:08 0:00 [rpciod]
root 17 0.0 0.0 0 0 ? S 11:08 0:00 [khungtaskd]
root 18 0.0 0.0 0 0 ? S 11:08 0:01 [kswapd0]
root 19 0.0 0.0 0 0 ? S 11:08 0:00 [fsnotify_mark]
root 20 0.0 0.0 0 0 ? S< 11:08 0:00 [crypto]
root 27 0.0 0.0 0 0 ? S 11:08 0:00 [spi32766]
root 28 0.0 0.0 0 0 ? S< 11:08 0:00 [ci_otg]
root 30 0.0 0.0 0 0 ? S< 11:08 0:00 [deferwq]
root 31 0.0 0.0 0 0 ? S 11:08 0:00 [kworker/u:2]
root 32 0.1 0.0 0 0 ? S 11:08 0:01 [mmcqd/0]
root 54 0.0 0.0 0 0 ? S< 11:08 0:00 [kworker/0:1H]
root 127 0.5 2.4 3392 1336 ? Ss 11:09 0:08 /sbin/udevd --daemon
root 164 0.0 0.0 0 0 ? S< 11:09 0:00 [hci0]
root 165 0.0 0.0 0 0 ? S< 11:09 0:00 [kworker/u:1H]
root 174 0.0 0.0 0 0 ? S< 11:09 0:00 [cfg80211]
root 289 0.0 1.1 1860 620 ? Ss 11:09 0:00 /usr/sbin/syslogd
root 293 0.0 0.8 1776 448 ? Ss 11:09 0:00 /usr/sbin/klogd -c 3 -x
root 521 0.0 2.0 5556 1124 ? Ss 11:09 0:00 wpa_supplicant -B -i wlan0 -c /etc/
root 608 0.0 0.6 2036 340 ? Ss 11:10 0:00 /sbin/dhcpcd -t 10 eth0
root 637 0.0 0.0 0 0 ? S 11:10 0:00 [kworker/0:3]
root 730 0.0 0.6 2036 340 ? Ss 11:10 0:00 /sbin/dhcpcd -t 10 wlan0
bin 788 0.0 0.8 1908 484 ? Ss 11:10 0:00 /sbin/rpc.portmap
root 792 0.0 1.5 2136 832 ? Ss 11:10 0:00 /sbin/rpc.statd
root 846 0.0 1.0 1848 572 ? Ss 11:10 0:00 /usr/sbin/inetd
root 849 0.0 1.7 4616 980 ? Ss 11:10 0:00 /usr/sbin/sshd
root 863 0.0 0.4 2056 224 ? Ss 11:10 0:00 /usr/sbin/rpc.rquotad
root 867 0.0 0.0 0 0 ? S 11:10 0:00 [lockd]
root 868 0.0 0.0 0 0 ? S 11:10 0:00 [nfsd]
root 869 0.0 0.0 0 0 ? S 11:10 0:00 [nfsd]
root 870 0.0 0.0 0 0 ? S 11:10 0:00 [nfsd]
root 871 0.0 0.0 0 0 ? S 11:10 0:00 [nfsd]
root 872 0.0 0.0 0 0 ? S 11:10 0:00 [nfsd]
root 873 0.0 0.0 0 0 ? S 11:10 0:00 [nfsd]
root 874 0.0 0.0 0 0 ? S 11:10 0:00 [nfsd]
root 875 0.0 0.0 0 0 ? S 11:10 0:00 [nfsd]
root 877 0.0 1.0 2496 556 ? Ss 11:10 0:00 /usr/sbin/rpc.mountd
root 883 0.0 3.2 5348 1784 ? Ss 11:10 0:00 /usr/sbin/ntpd -g -U 120 -p /var/ru
81 898 0.0 1.5 2912 864 ? Ss 11:10 0:00 /usr/bin/dbus-daemon --system
root 901 0.0 3.3 4232 1820 ? Ss 11:10 0:00 /usr/sbin/bluetoothd
root 908 0.0 1.2 2108 668 ? Ss 11:10 0:00 /usr/sbin/crond -l notice
daemon 910 0.0 0.7 2104 400 ? Ss 11:10 0:00 /usr/sbin/atd -b 15 -l 1
root 918 0.0 0.0 0 0 ? S< 11:10 0:00 [krfcommd]
root 925 0.0 1.7 3192 980 ? Ss 11:10 0:00 SCREEN -d -m /etc/rc.d/rc.map_ssh
root 926 0.0 1.4 2116 772 tty1 Ss+ 11:10 0:00 /sbin/agetty --noclear 38400 tty1 l
root 927 0.0 1.4 2116 772 tty2 Ss+ 11:10 0:00 /sbin/agetty 38400 tty2 linux
root 928 0.0 1.4 2116 772 tty3 Ss+ 11:10 0:00 /sbin/agetty 38400 tty3 linux
root 929 0.0 1.4 2116 772 tty4 Ss+ 11:10 0:00 /sbin/agetty 38400 tty4 linux
root 930 0.0 1.4 2116 772 tty5 Ss+ 11:10 0:00 /sbin/agetty 38400 tty5 linux
root 931 0.0 1.4 2116 772 tty6 Ss+ 11:10 0:00 /sbin/agetty 38400 tty6 linux
root 932 0.0 1.3 2116 748 ttyAMA0 Ss+ 11:10 0:00 /sbin/agetty 115200 ttyAMA0 vt100
root 933 0.1 2.1 2720 1152 pts/0 Ss+ 11:10 0:01 /bin/sh /etc/rc.d/rc.map_ssh
root 1237 3.6 4.0 7176 2216 ? Rs 11:33 0:00 sshd: root@pts/1
root 1239 5.2 3.4 4880 1916 pts/1 Ss 11:33 0:00 -bash
root 1258 0.5 0.8 1768 448 pts/0 S+ 11:33 0:00 sleep 10
root 1259 0.0 2.1 3124 1168 pts/1 R+ 11:33 0:00 ps aux
root@aileen:~#
I have a bit more free men but also not that mush:
[root@alarm ~]# cat /proc/version
Linux version 3.7.4-dirty (chris@thinkpad) (gcc version 4.7.3 20121207 (release) [ARM/embedded-4_7-branch revision 194305] (GNU Tools for ARM Embedded3
[root@alarm ~]# cat /proc/meminfo |head -n 10
MemTotal: 52188 kB
MemFree: 17636 kB
Buffers: 2380 kB
Cached: 19232 kB
SwapCached: 0 kB
Active: 9036 kB
Inactive: 17256 kB
Active(anon): 4708 kB
Inactive(anon): 168 kB
Active(file): 4328 kB
[root@alarm ~]# ps -aux |head -n 10
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 2.1 4.8 4768 2516 ? Ss 01:00 0:03 /usr/lib/systemd/systemd
root 2 0.0 0.0 0 0 ? S 01:00 0:00 [kthreadd]
root 3 0.1 0.0 0 0 ? S 01:00 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S 01:00 0:00 [kworker/0:0]
root 5 0.0 0.0 0 0 ? S< 01:00 0:00 [kworker/0:0H]
root 6 0.0 0.0 0 0 ? S 01:00 0:00 [kworker/u:0]
root 7 0.0 0.0 0 0 ? S< 01:00 0:00 [kworker/u:0H]
root 8 0.0 0.0 0 0 ? S 01:00 0:00 [watchdog/0]
root 9 0.0 0.0 0 0 ? S< 01:00 0:00 [khelper]
[root@alarm ~]#
It seems systemd-journald is using most memory on my system:
[root@alarm ~]# ps -eo pmem,pcpu,vsize,pid,cmd | sort -k 1 -nr | head -5
10.5 0.4 69648 58 /usr/lib/systemd/systemd-journald
5.6 0.1 7040 96 /usr/sbin/syslog-ng -F
4.8 0.5 4768 1 /usr/lib/systemd/systemd
4.2 0.0 6272 94 /usr/sbin/sshd -D
3.3 0.1 3268 140 -bash
[root@alarm ~]#
I was able to reduce its memory usage by setting Storage=none in /etc/systemd/journald.conf,
I've written down my experiments here: http://www.jann.cc/2013/02/02/how_to_check_the_memory_usage_of_your_embedded_linux_system.html.
Thank you Christian !
nice blog btw :)
I have disabled the lockdep facility, and enabled DEBUG_INFO_REDUCED. The avaibale memory increased to ~60MB. I think there is not much more to sqeeze.
$ free
total used free shared buffers cached
Mem: 60084 58640 1444 0 14076 26896
-/+ buffers/cache: 17668 42416
Swap: 32764 0 32764
Of course you can get to much less than 17668 kB of "used" memory but I am running multiple services so this is what I get on startup.
Kernel source and config available at http://5mao.bbsindex.com/iMX233-OLinuXino-MICRO/kernel/ (http://5mao.bbsindex.com/iMX233-OLinuXino-MICRO/kernel/)