Skip to content

linux: show M_PRIV instead of M_SHARE in default columns#1955

Merged
natoscott merged 2 commits intohtop-dev:mainfrom
ugolnikovE:issue-492
Apr 15, 2026
Merged

linux: show M_PRIV instead of M_SHARE in default columns#1955
natoscott merged 2 commits intohtop-dev:mainfrom
ugolnikovE:issue-492

Conversation

@ugolnikovE
Copy link
Copy Markdown
Contributor

Replaces M_SHARE with M_PRIV in the default Linux Main screen columns, as suggested in #492. M_PRIV (RES - SHR) is a more actionable per-process memory metric than shared pages alone.

M_RESIDENT is kept as it remains the de-facto standard memory column across process viewers. M_SHARE is removed since it becomes redundant with M_PRIV. Users who want either column back can re-add them via the Setup screen (F2).

PCP also exposes M_PRIV but its defaults are left unchanged to keep this PR focused on Linux; happy to extend in a follow-up if desired.

Also documents M_PRIV in the man page.

Tested on Debian aarch64 with a fresh config: PRIV column appears in place of SHR, sorting works, config saves and reloads cleanly.

Closes #492

Replace M_SHARE (SHR) with M_PRIV (PRIV) in the default Main screen
columns on Linux. M_PRIV shows the process's private memory
(RES - SHR), which is a more actionable metric for understanding
per-process memory cost than the shared pages size alone.

Also document M_PRIV in the man page.

Closes htop-dev#492
Signed-off-by: Evgeny Ugolnikov <evgeny.ugolnik@gmail.com>
@fasterit fasterit added the default change Changes a default setting or default UI object label Apr 12, 2026
@BenBE BenBE added the Linux 🐧 Linux related issues label Apr 12, 2026
Copy link
Copy Markdown
Member

@natoscott natoscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. If you are happy to add the PCP change needed, please go ahead with that too (perhaps in a follow-up commit or even separate PR if you prefer).

Apply the same default-column change to the PCP platform for
consistency with the Linux defaults updated in the previous commit.

Signed-off-by: Evgeny Ugolnikov <evgeny.ugolnik@gmail.com>
@ugolnikovE
Copy link
Copy Markdown
Contributor Author

Added the PCP commit.
While testing, I noticed that PRIV and SHR display without unit suffixes in pcp-htop, while RES and VIRT show correctly (see screenshot).
Couldn't find an existing issue. Should I open one, or is it known?
Screenshot 2026-04-15 at 22 44 06

@natoscott
Copy link
Copy Markdown
Member

Couldn't find an existing issue. Should I open one, or is it known?

@evelikov that sounds like the metric units may be incorrect - but from a quick look, doesn't seem so - both are in units of KiB. I'll take a close look when I can. It's not a known issue so please go ahead and open that new issue, thanks!

@natoscott
Copy link
Copy Markdown
Member

Ah, I see the problem - PR to follow, don't worry about a new issue.

natoscott added a commit to natoscott/htop that referenced this pull request Apr 15, 2026
@natoscott natoscott merged commit 2695822 into htop-dev:main Apr 15, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

default change Changes a default setting or default UI object Linux 🐧 Linux related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add column with showing per-process unique memory usage value (calculate RES - SHR)

4 participants