Bug 871844 - top utility can't sort by memory usage in batch mode
top utility can't sort by memory usage in batch mode
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: procps-ng (Show other bugs)
19
All Linux
low Severity low
: ---
: ---
Assigned To: Jaromír Cápík
Branislav Náter
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-31 10:13 EDT by Branislav Náter
Modified: 2016-01-31 20:57 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-31 13:01:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 1 Fedora End Of Life 2013-04-03 16:05:22 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
Comment 2 Jaromír Cápík 2013-04-11 09:12:11 EDT
please, retest with 3.3.7 ...

-m switch replaced with more universal -o <field> switch

Example:

top -b -n1 -o %MEM
Comment 3 Branislav Náter 2013-11-04 12:19:45 EST
Thanks for implementing this option. 

$ rpm -q procps-ng
procps-ng-3.3.8-10.fc19.x86_64

Sort output according memory usage:

$ top -b -n1 -o %MEM | head -n15
top - 18:17:18 up 10 days,  8:42, 18 users,  load average: 1.10, 0.92, 0.81
Tasks: 303 total,   1 running, 302 sleeping,   0 stopped,   0 zombie
%Cpu(s): 19.0 us,  4.0 sy,  0.0 ni, 74.4 id,  1.7 wa,  0.5 hi,  0.2 si,  0.0 st
KiB Mem:   3842860 total,  3646388 used,   196472 free,       60 buffers
KiB Swap:  5947388 total,  2171220 used,  3776168 free,   586100 cached

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
26009 bnater    20   0 2667592 565436  12564 S  12.5 14.7 285:14.54 gnome-shell
26758 bnater    20   0 1845060 381980  16212 S   0.0  9.9 152:04.98 firefox
26112 bnater    20   0 1303264 140556  15412 S   6.3  3.7 415:05.35 chrome
26955 bnater    20   0 1255960 117492  15284 S   0.0  3.1  25:18.28 chrome
 5982 bnater    20   0 2724392  98916   4104 S   0.0  2.6   2:48.21 dropbox
27038 bnater    20   0 1170032  98236  14756 S   0.0  2.6   2:31.78 chrome
27284 bnater    20   0 1219200  98196  15876 S   0.0  2.6  20:03.28 chrome
27144 bnater    20   0 1270428  97240  15664 S   0.0  2.5  25:58.30 chrome
Comment 4 Jaromír Cápík 2014-01-31 13:01:49 EST
Thanks for the test ... closing.

Note You need to log in before you can comment on or make changes to this bug.