bpytop: [BUG] Long pauses / freezing on Linux

There are no errors in the error log for this condition, so I’m not sure how to begin troubleshooting it.

On a newly installed Linux Mint 20 (XFCE) system, MacBook3,1 from 2007 with 6GBs of RAM.

Symptoms:

Entire UI just stops updating and is unresponsive. If I press any keys those actions will all be performed after the freeze is over.

I’ve counted freeze durations of up to 20 seconds. Many of around 5-10 seconds.

This is with the refresh rate generally set to 2000ms (2 seconds).

I manually updated psutil using the instructions you provided, so the versions are:

bpytop version: 1.0.20
psutil version: 5.7.2

When this happens there is no sign of the CPU being overwhelmed with activity, nor any sign of unusual disk activity.

I can only surmise the bpytop (or some subcomponent like psutil) is encountering some sort of race condition in the background. Besides implementing time-based logic in the code that counts how long each function takes to respond and throws errors when it is longer than expected, I’m not sure how to even begin figuring out what is happening.

I haven’t noticed any similar symptoms in any other GUI or terminal application. Only bpytop seems to be behaving this way. And I haven’t seen this as far as I know on other systems I have available.

Starting with an empty error log, I ran bpytop --debug just long enough to experience an obvious long freeze, then exited. It didn’t take long. This is the resulting log:

23/08/20 (22:40:20) | INFO: New instance of bpytop version 1.0.20 started with pid 33142
23/08/20 (22:40:20) | INFO: Loglevel set to DEBUG
23/08/20 (22:40:20) | DEBUG: Using psutil version 5.7.2
23/08/20 (22:40:20) | DEBUG: CMD: /usr/local/bin/bpytop --debug
23/08/20 (22:40:22) | DEBUG: Collect and draw completed in 0.397569 seconds
23/08/20 (22:40:23) | DEBUG: Init completed in 2.752632 seconds
23/08/20 (22:41:05) | INFO: Exiting. Runtime 0:00:45 

Seems to have no information about what is happening.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (17 by maintainers)

Most upvoted comments

@RedBearAK We can leave this open for the time being since it isn’t solved, and if others experience the same problems they’ll hopefully report it here.

Hopefully then we can pinpoint exactly where the slowdown is happening. If it even is just one function, could be that most psutil functions are slowed down since most of them read from /proc. And since I can’t reproduce this myself, it’s pretty hard writing and testing fixes for it.

My OCD wants you to think about using the more “orderly” format, but I doubt it will ever be a big deal either way.

Changing it now would certainly be confusing with different versions having different formats, but hopefully people shouldn’t even need to reading the error.log if I keep my coding clean 😃