Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 591762

Summary: sys-process/procps: top: memory based fields goof on >1G
Product: Gentoo Linux Reporter: Raymond Jennings <shentino>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: UNCONFIRMED ---    
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
Screenshot of top, with an orange circle highlighting the problem.
patch
update

Description Raymond Jennings 2016-08-20 21:46:09 UTC
When top is trying to print a memory based field, it looks really weird if the amount is over a few G

Instead of ##.#g, it shows as 0.0##t
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2016-08-21 10:14:53 UTC
That's short for terabytes. Try pressing `e' (for task memory scale) and `E' (for summary memory scale) a few times.

Also, please post your `emerge --info sys-process/procps' output in a comment.
Comment 2 Raymond Jennings 2016-08-21 16:58:58 UTC
Created attachment 443826 [details]
emerge --info
Comment 3 Raymond Jennings 2016-08-21 17:02:28 UTC
Pressing "e" does change the scale, but for some reason if I run a program with >10G in RSS, it comes up as 0.010t something instead of 10.XXXg.

The VIRT field however shows up fine.

It also displays fine if its <10G, so RSS of 9.XXXg shows up as expected, it just switches to terabytes if it goes over <10G, but it should only do that for over <1024G, as 10.00g instead of 0.010t

my guess is that its a reaction to the field width being unexpectedly narrower than needed.
Comment 4 Raymond Jennings 2016-08-21 17:03:14 UTC
Pressing 'e' doesn't really help much.

As a test, run a program that allocates more than 10G in RSS, and top will show it as 0.010t instead of 10.000g.
Comment 5 Raymond Jennings 2016-08-21 18:43:34 UTC
Created attachment 443834 [details]
Screenshot of top, with an orange circle highlighting the problem.

This shows the 18g vs 0.018t thing I was talking about.

Wrote a quick program to allocate and touch 18g of memory.
Comment 6 Mike Gilbert gentoo-dev 2016-08-23 01:40:18 UTC
This seems like the sort of thing you should report to the upstream developers, but to the Gentoo maintainer.
Comment 7 Mike Gilbert gentoo-dev 2016-08-23 01:40:50 UTC
(In reply to Mike Gilbert from comment #6)

Sorry, that should say "not to the Gentoo maintainer".
Comment 8 Raymond Jennings 2016-08-24 20:29:22 UTC
Created attachment 444056 [details, diff]
patch

In the meantime, how do you guys like this patch?
Comment 9 Raymond Jennings 2016-08-24 20:38:03 UTC
Created attachment 444058 [details, diff]
update
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-02 09:56:51 UTC
DId you send it upstream?