aristocratos / btop

A monitor of resources
Apache License 2.0
20.59k stars 635 forks source link

[BUG] MemB and Threads keeps rising after collapsing a process in tree mode. #526

Open MrPigss opened 1 year ago

MrPigss commented 1 year ago

Describe the bug

The total MemB and threads of a process seems to increment when collapsed in tree mode.

To Reproduce

Expected behavior

Btop shows the total memory usage of that process and it's child processes.

Screenshots

uncollapsed screenshot -> memory seems fine

image

with launchd collapsed (this number keeps going up with 9GB per tick)

image

It stops rising after opening back up but stays at the number it was at.

image

It does this with any process, at some point it reported Iterm using around 14gb of memory while activity monitor said 439MB.

Info (please complete the following information):

Additional context

contents of ~/.config/btop/btop.log

2023/05/12 (14:00:14) | ===> btop++ v.1.2.13
2023/05/12 (14:00:14) | WARNING: No UTF-8 locale detected! Some symbols might not display correctly.

2023/05/12 (14:03:04) | ===> btop++ v.1.2.13
2023/05/12 (14:03:04) | WARNING: No UTF-8 locale detected! Some symbols might not display correctly.

2023/05/12 (14:12:42) | ===> btop++ v.1.2.13
2023/05/12 (14:12:42) | WARNING: No UTF-8 locale detected! Some symbols might not display correctly.

2023/05/12 (14:15:21) | ===> btop++ v.1.2.13
2023/05/12 (14:15:21) | WARNING: No UTF-8 locale detected! Some symbols might not display correctly.
TeddyHuang-00 commented 1 year ago

I have the same issue here. Installed v1.2.13 via homebrew. The memory does not sum up when the tree is expanded, yet keeps increasing when collapsed. I think there must be some bug with tree collapsed behavior and how the memory profiler add the numbers up.

zjxoi commented 4 months ago

Hello! Having the same issue with v1.3.2. The strange thing is that it started to happen a few days ago, with same exact version. Could it be related to how the btop process is handled by macOS?

ikonikon commented 1 month ago

I have the same issue on v1.3.2 - as soon as the process tree is collapsed, the memory usage keeps increasing in an unbounded fashion. Increase interval seems equal to the calculation rate, while increase amount seems roughly to be equal to the actual amount being used. Looks like a bug in the calculation.