Skip to content

Sorted by pmem

On this SLES11sp2 system, ps won't sort by "percent of physical memory":
$ ps -eo vsz,rss,pmem,pid --sort -rss | head -4
   VSZ   RSS %MEM   PID
597624 515344  3.0 3201
395936 108752  0.6 15819
2254136 59280  0.3 39188

$ ps -eo vsz,rss,pmem,pid --sort -pmem | head -4
   VSZ   RSS %MEM   PID
 10528   840  0.0     1
     0     0  0.0     2
     0     0  0.0     3
Turns out SLESsp2 (released 29 Feb 2012) still ships with procps version 3.2.7, even though this had been fixed back in 2010:
$ rpm -q --queryformat "%{NAME} %{VERSION} %{URL}\n" $(rpm -qf `which ps`) 
procps 3.2.7 http://procps.sf.net