Bug 238123

Summary: per process swap usage in top(1) broken
Product: Base System Reporter: Eugene Grosbein <eugen>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People CC: kib, ota
Priority: ---    
Version: 11.2-STABLE   
Hardware: Any   
OS: Any   

Description Eugene Grosbein freebsd_committer freebsd_triage 2019-05-25 22:43:01 UTC
"top -w -o space" is supposed to show approximate swap usage per process sorting list of processes by swap usage. This is what it shows for stable/11 r345946 (11.2-STABLE/amd64) with GENERIC kernel after swapoff(8) invocation:

last pid:  9909;  load averages:  0.35,  0.29,  0.27    up 50+00:09:28  22:31:18
59 processes:  1 running, 58 sleeping
CPU:  0.0% user,  0.0% nice,  2.0% system,  0.0% interrupt, 98.0% idle
Mem: 108M Active, 330M Inact, 317M Laundry, 1096M Wired, 60M Free
ARC: 118M Total, 17M MFU, 64M MRU, 32K Anon, 3162K Header, 34M Other
     53M Compressed, 192M Uncompressed, 3.65:1 Ratio
Swap:

  PID USERNAME    THR PRI NICE   SIZE    RES   SWAP STATE    TIME    WCPU COMMAND
40557 squid         1  52    0 20752K     0K  9376K wait     0:00   0.00% <squid>
94177 eugen         1  20    0  7860K     0K  3080K wait     0:00   0.00% <bash>
58019 eugen         1  23    0  7860K     0K  3068K wait     0:00   0.00% <bash>
  992 eugen         1  23    0  7860K     0K  3064K wait     0:00   0.00% <bash>
26511 eugen         1  23    0  7860K     0K  2576K wait     0:00   0.00% <bash>
83131 eugen         1  21    0  7860K     0K  2576K wait     0:00   0.00% <bash>

top was restarted but numbers are same as before swapoff: it shows some processes as swapped out but there is no swap now.
Comment 1 Eugene Grosbein freebsd_committer freebsd_triage 2019-05-25 22:46:57 UTC
The command should be "top -w -o swap" (s/space/swap).