OpenWrt Forum Archive

Topic: please clarify %VSZ meaning

The content of this topic has been archived on 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

root@OpenWrt:~# top
Mem: 28132K used, 1052K free, 0K shrd, 2292K buff, 7520K cached
CPU:   0% usr   9% sys   0% nic   9% idle  81% io   0% irq   0% sirq
Load average: 1.96 1.86 1.83 1/52 2161
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 2161  2156 root     R     1496   5%   9% top
 1699     1 root     S    37140 127%   0% /usr/bin/python /usr/share/python/pyl
  652     1 root     S     1508   5%   0% /sbin/syslogd -C16
  666     1 root     S     1508   5%   0% /sbin/netifd
  902     1 root     S     1504   5%   0% /usr/sbin/ntpd -n -p 0.openwrt.pool.n
    1     0 root     S     1504   5%   0% init
 2156  2155 root     S     1504   5%   0% -ash
  519     1 root     S     1504   5%   0% init
 1328     1 root     S     1500   5%   0% /sbin/watchdog -t 5 /dev/watchdog
  654     1 root     S     1488   5%   0% /sbin/klogd
 2155   847 root     S     1216   4%   0% /usr/sbin/dropbear -P /var/run/dropbe
root@OpenWrt:~# free
             total         used         free       shared      buffers
Mem:         29184        28356          828            0         2912
-/+ buffers:              25444         3740
Swap:       104416         6624        97792

please can someone have a look at the vsz of pyload and explain me what does it mean???

From BusyBox

top.c-  /*
top.c:   * %VSZ = s->vsz/MemTotal
top.c-   */

vzs is the size of the virtual memory used by the process (from /proc/<pid>/stat). This can include uninitialized memory and memory shared with other processes, and is therefore largely useless to determine how much memory a process actually needs.

MemTotal is found in /proc/meminfo, and is basically how much RAM you have.

Why BusyBox presents the ratio between these I do not know, it seems mostly useless.

Install something like htop for a more accurate view with more memory measurements.

There also exists a python script (http://www.selenic.com/smem/) that tries to make a fair accounting of each process memory usage, but it requires /proc/<pid>/smaps, which is not available on all OpenWrt architectures.

(Last edited by Cybjit on 23 Jul 2012, 22:17)

really thanks for these infos!

a question remain.. i see that it indicates 37140 Kb of memory usage, while from "free" i see a total of 28356+6624swap, that is lower... how is this possible?

nebbia88 wrote:

really thanks for these infos!

a question remain.. i see that it indicates 37140 Kb of memory usage, while from "free" i see a total of 28356+6624swap, that is lower... how is this possible?

As I said, the virtual memory measurement can include uninitialized memory.

(Last edited by Cybjit on 23 Jul 2012, 22:54)

Cybjit wrote:
nebbia88 wrote:

really thanks for these infos!

a question remain.. i see that it indicates 37140 Kb of memory usage, while from "free" i see a total of 28356+6624swap, that is lower... how is this possible?

As I said, the virtual memory measurement can include uninitialized memory.

ah ok i got it, so the "free" shows only the "really used" memory?
thanks again

nebbia88 wrote:

ah ok i got it, so the "free" shows only the "really used" memory?
thanks again

More or less, BusyBox free doesn't report the file system cache separately, which could be seen as available memory.

The discussion might have continued from here.