There is an interactive key "M" to sort by memory, which seems to be sorting on resident memory. Is there a way to sort on virtual memory? I happen to be working on Redhat Linux, but the question is not specific to this distribution.
Asked
Active
Viewed 2.0k times
3 Answers
8
You get a list of things you can sort by by pressing O
. Virtual segment size is option o
, so you can get what you want by pressing Oo<Enter>
.

Lars Kotthoff
- 646
- 4
- 10
6
Try pressing F
or O
in top, that should allow you to select the column you want to sort by.

Janne Pikkarainen
- 31,852
- 4
- 58
- 81
-
then hit enter (other keys are possible) to get back to the initial view – euphoria83 May 06 '15 at 22:32
-
Letter [O], `-mem` or `-vsize`, [enter] works on MacOS. – Cees Timmerman Apr 06 '17 at 08:39
0
top -u test -o VIRT
Where -u is the users whose processes you are interested in and -o is the field to filter on, yields something like

Lefty G Balogh
- 413
- 4
- 8