Bug 144285 - [patch] ps(1): ps -axo user,%cpu,%mem - most processes using 0% of memory
Summary: [patch] ps(1): ps -axo user,%cpu,%mem - most processes using 0% of memory
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 7.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-02-25 14:50 UTC by admin
Modified: 2022-10-17 12:39 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (445 bytes, patch)
2010-02-25 14:50 UTC, admin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description admin 2010-02-25 14:50:00 UTC
Modern computers have a large amount of memory.
But, in ps(1) source I see:
(void)printf("%*.1f", v->width, getpcpu(k));
(void)printf("%*.1f", v->width, getpmem(k));
0.1% - it very big.
for 8Gb ram it = 8mb
Many of the processes is less than this number.

Fix: see patch

Patch attached with submission follows:
How-To-Repeat: ps -axo user,%cpu,%mem
Comment 1 Hiren Panchasara freebsd_committer freebsd_triage 2013-05-11 10:32:46 UTC
Responsible Changed
From-To: freebsd-bugs->hiren

Grab.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:49 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Piotr Pawel Stefaniak freebsd_committer freebsd_triage 2020-06-21 16:54:40 UTC
I've looked into this. The change inevitably adds more characters to output (mostly replacing 0.0 with 0.00) and I can see someone feeling that it'd be less readable. Personally, most of the time I don't need more precision than the current default of .1 yields -- and if I wanted, I'd probably be satisfied using -o rss instead.
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:39:03 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>