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

htop doesn't report shared memory usage on Linux #1443

Open
jart opened this issue Apr 11, 2024 · 4 comments
Open

htop doesn't report shared memory usage on Linux #1443

jart opened this issue Apr 11, 2024 · 4 comments
Labels
bug 🐛 Something isn't working Linux 🐧 Linux related issues

Comments

@jart
Copy link

jart commented Apr 11, 2024

In the screenshot below, you'll see that one of my processes is using 139GB of memory, but htop reports the system using 6GB of RAM.

image

It's because htop hides mmap(MAP_SHARED) memory. This has caused a great deal of confusion in the machine learning community over the past year. For example https://twitter.com/JustineTunney/status/1778420352504512774 one Twitter user got snagged by poor performance because his system was swapping, but according to htop everything was fine.

Could htop start reporting this information? Thanks!

@BenBE BenBE added bug 🐛 Something isn't working Linux 🐧 Linux related issues labels Apr 12, 2024
@BenBE
Copy link
Member

BenBE commented Apr 12, 2024

Okay, something seems off here …

Can you provide a copy of /proc/meminfo with what htop reports alongside? Shared memory should be handled already.

Also, which htop version/release?

@fish98
Copy link

fish98 commented May 6, 2024

Hi, I might experience the same issue with htop version 3.3.0-2 on ArchLinux where the swap memory usage statistics of htop differs from those shown by top and /proc/meminfo. Please find the following screenshot for more detailed information. I tested Line 213-215 in linux/LinuxMachine.c and found these variables match with the correct memory consumption listed in meminfo. I suppose these variables were incorrectly changed during the whole htop workflow although I have not investigated the root cause in depth.

htop

PTAL, thank you :)

@cgzones
Copy link
Member

cgzones commented May 6, 2024

@fish98 your observed behavior is probably due to the zswap handling, see 71f5a80 and 71f2e66

@fish98
Copy link

fish98 commented May 15, 2024

@fish98 your observed behavior is probably due to the zswap handling, see 71f5a80 and 71f2e66

Thanks for your reply :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working Linux 🐧 Linux related issues
Projects
None yet
Development

No branches or pull requests

4 participants