Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to hide or show Cache and Buffers in Graph mode #1540

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

batk0
Copy link

@batk0 batk0 commented Sep 25, 2024

This PR covers issue #407.

[x]    Show cached memory in graph

Added this option to "Display Options". It's enabled by default to be compatible with current behavior. Disabling it will remove Cache and Buffers memory from Memory Graph and Mem&Swp Graph.

DisplayOptionsPanel.c Outdated Show resolved Hide resolved
MemoryMeter.c Outdated Show resolved Hide resolved
MemoryMeter.c Outdated Show resolved Hide resolved
@Explorer09
Copy link
Contributor

I expect this PR be rebased on / merged with #928. Otherwise I fear this would conflict with the multi-color graph feature I already proposed in #714.

@batk0
Copy link
Author

batk0 commented Sep 25, 2024

I expect this PR be rebased on / merged with #928. Otherwise I fear this would conflict with the multi-color graph feature I already proposed in #714.

No problem. I can rebase as soon as #928 is merged. Otherwise I don't know what to do.

MemoryMeter.c Show resolved Hide resolved
@BenBE
Copy link
Member

BenBE commented Sep 26, 2024

The actual change looks good (should be one commit though, not two), but I'm not very eager about the feature overall.

@fasterit @natoscott What do you think?

@fasterit
Copy link
Member

I think for consistency reasons this switch should also affect the bar mode.
I'm not against it, it's small and fits a use case of seeing how much memory is used and not-easily evictable.
/DLange

Copy link
Member

@fasterit fasterit left a comment

Choose a reason for hiding this comment

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

As I said on a comment this should also affect bar mode.

The cheap "NaN" stunt causes an assert failure:

stderr output >>>>>>>>>>
htop: Meter.c:409: Meter_humanUnit: Assertion `value >= 0.0' failed.
<<<<<<<<<< stderr output <<<<<<<<<<

The code also needs to save the setting to htoprc and print it in the crash handler (the Settings handling is incomplete).

MemoryMeter.c Outdated Show resolved Hide resolved
@natoscott
Copy link
Member

@fasterit @natoscott What do you think?
I'm not against it, it's small and fits a use case [...]

I don't love it, as it adds yet another configurable option many people wont need and the Options menu is already cluttered. OTOH I don't see any better solution, so I wont object to it being added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants