ps -vxa sortiert nicht nach Speicher

ps -vxa sortiert nicht nach Speicher

DerFreeBSD-Manpage zupssagt:

-v   Display information associated with the following keywords: pid,
     state, time, sl, re, pagein, vsz, rss, lim, tsiz, %cpu, %mem, and
     command.  The -v option implies the -m option.

aber so scheint es einfach nicht zu funktionieren. -msoll nach Speichernutzung sortieren:

-m   Sort by memory usage, instead of the combination of controlling
     terminal and process ID.

Dies ist jedoch eine Teilausgabe von ps -vxa:

 PID STAT    TIME  SL  RE PAGEIN     VSZ    RSS LIM TSIZ  %CPU %MEM COMMAND
 ...
 871 Is   0:00.04 127 127     10   75620   7704   -  400   0.0  0.1 /usr/lo
1043 S    0:03.18   0 127   9599 1656244 253048   -  172   0.0  3.1 /usr/lo
1046 S    0:09.48   0 127    412 1672996 264060   -  172   0.0  3.3 /usr/lo
 873 I    0:00.14 127 127    123   65956  11432   -  280   0.0  0.1 /usr/lo

Was ist also hier passiert? Wo ist die Sortierung, wie wir sie aus der Beschreibung von erwarten würden -m?

Antwort1

Die Sortierung erfolgt direkt dort.

Das Problem besteht darin, dass Sie erwarten, dass beim Sortieren nach „Speichernutzung“ nach einem einzigen sichtbaren Feld sortiert wird. Es ist schlecht dokumentiert, aber die „Speichernutzung“, nach der sortiert wird, ist ein unsichtbares und tatsächlich nicht druckbares Feld, das die Summe der Felder dsiz, ssiz, und darstellt tsiz.

verwandte Informationen