Linux Smem tool for detailed memory report

Linux Smem tool for detailed memory report

Using smem command we can check actual RAM utilized by a user. smem reports shows you physical memory usage,taking shared memory pages into account. Unshared memory is reported as USS (Unique Set Size). Shared memory is divided equally among the processes sharing that memory. The unshared memory and a process proportion of shared memory is reported as the PSS (Proportional Set Size). The USS and PSS only includes physical memory usage.

smem-linux-logo

Installing smem

[root@TTS~]# yum install smem
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package smem.noarch 0:0.9-1.fc13 set to be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================
Package Arch Version Repository Size
================================================================
Installing:
smem noarch 0.9-1.fc13 fedora 19 k

Transaction Summary
================================================================
Install 1 Package(s)

Total download size: 19 k
Installed size: 38 k
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
fedora/prestodelta | 414 B 00:00
Processing delta metadata
Package(s) data still to download: 19 k
smem-0.9-1.fc13.noarch.rpm | 19 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : smem-0.9-1.fc13.noarch 1/1

Installed:
smem.noarch 0:0.9-1.fc13

Complete!

Feautures of smem

* It will list system overview
* It will list by process,mapping,user
* It will filter by process,mapping,user
* reading live data from /proc directory
* reading data snapshots from directory mirrors or compressed tarballs
* lightweight capture tool for embedded systems
* builtin chart generation…,

[root@TTS ~]# smem
PID User Command Swap USS PSS RSS
813 root /usr/bin/system-setup-keybo 44 4 4 76
1246 root rpc.idmapd 168 4 4 104
1318 root avahi-daemon: chroot helpe 156 4 4 136
1588 root /sbin/mingetty /dev/tty2 48 4 5 192
1590 root /sbin/mingetty /dev/tty3 52 4 5 192
1594 root /sbin/mingetty /dev/tty4 44 4 5 192
1596 root /sbin/mingetty /dev/tty5 44 4 5 192
1601 root /sbin/mingetty /dev/tty6 52 4 5 192
1201 root rpc.statd 228 4 6 324
1353 root /usr/sbin/acpid 80 4 6 276
1449 root xinetd -stayalive -pidfile 176 4 6 292
1701 gdm /usr/bin/dbus-launch –exit 208 4 6 300

It will report memory usage by mapping

[root@TTS ~]# smem -m
Map PIDs AVGPSS PSS
/dev/dri/card0 1 0 0
/dev/shm/pulse-shm-1529777352 1 0 0
/dev/shm/sem.FNcj5w 1 0 0
/dev/shm/sem.NEGx9x 1 0 0
/home/tts/.cache/mozilla/firefox/e17r8je 1 0 0
/lib/libcap-ng.so.0.0.0 3 0 0
/lib/libcap.so.2.17 7 0 0
/lib/libidn.so.11.5.45 2 0 0
/lib/libncurses.so.5.7 1 0 0
/lib/security/pam_console.so 1 0 0
/lib/security/pam_gnome_keyring.so 1 0 0
/lib/security/pam_loginuid.so 1 0 0
/lib/security/pam_namespace.so 1 0 0
/lib/security/pam_nologin.so 1 0 0
/lib/security/pam_selinux.so 1 0 0
/lib/security/pam_sepermit.so 1 0 0

It will report memory usage by user’s

[root@TTS ~]# smem -u
User Count Swap USS PSS RSS
gdm 2 1064 224 246 2000
root 76 22048 165908 201923 369972
tts 65 242424 843160 873164 1063956

It will report totals and percentages

[root@TTS ~]# smem -t -p
PID User Command Swap USS PSS RSS
813 root /usr/bin/system-setup-keybo 0.00% 0.00% 0.00% 0.00%
1246 root rpc.idmapd 0.01% 0.00% 0.00% 0.01%
1318 root avahi-daemon: chroot helpe 0.01% 0.00% 0.00% 0.01%
1588 root /sbin/mingetty /dev/tty2 0.00% 0.00% 0.00% 0.01%
1590 root /sbin/mingetty /dev/tty3 0.00% 0.00% 0.00% 0.01%
1594 root /sbin/mingetty /dev/tty4 0.00% 0.00% 0.00% 0.01%
1596 root /sbin/mingetty /dev/tty5 0.00% 0.00% 0.00% 0.01%
1601 root /sbin/mingetty /dev/tty6 0.00% 0.0smem -s rss -r0% 0.00% 0.01%
1201 root rpc.statd 0.01% 0.00% 0.00% 0.02%

It will report different coloumns

[root@TTS ~]# smem -c “name user pss”
Name User PSS
avahi-daemon root 4
rpc.idmapd root 4
system-setup-ke root 4
mingetty root 5
mingetty root 5
mingetty root 5
mingetty root 5
mingetty root 5
acpid root 6
bash tts 6

Process filtered by mapping

[root@TTS ~]# smem -M libxml
PID User Command Swap USS PSS RSS
1484 root /usr/sbin/abrtd 20 0 0 0
1611 root /usr/libexec/gdm-simple-sla 20 0 0 0
1970 tts /usr/libexec/gnome-settings 20 0 0 0
1999 tts gnome-panel 20 0 0 0
2005 tts /usr/libexec/bonobo-activat 8 0 0 0

Maping filtered by process

[root@TTS ~]# smem -m -P [e]volution
Map PIDs AVGPSS PSS
/lib/ld-2.12.2.so 1 0 0
/lib/libcom_err.so.2.1 1 0 0
/lib/libcrypt-2.12.2.so 1 0 0
/lib/libcrypto.so.1.0.0d 1 0 0
/lib/libdb-4.8.so 1 0 0
/lib/libdl-2.12.2.so 1 0 0
/lib/libexpat.so.1.5.2 1 0 0
/lib/libfreebl3.so 1 0 0
/lib/libgcrypt.so.11.5.3 1 0 0
/lib/libgio-2.0.so.0.2400.1 1 0 0
/lib/libgmodule-2.0.so.0.2400.1 1 0 0
/lib/libgpg-error.so.0.5.0 1 0 0




Leave a Reply

Your email address will not be published. Required fields are marked *