beamium icon indicating copy to clipboard operation
beamium copied to clipboard

100% cpu usage on freebsd

Open knz opened this issue 5 years ago • 2 comments

Just installed from source since the OVH freebsd pkg archive doesn't deliver Freebsd 12 binaries yet.

The beamium binary is using 100% CPU.

Debugger reveals that the main loop in main.rs never sleeps: let watch_event_count = watcher_rx.try_iter().count(); completes immediately if there are no events, and the rest of the loop body doesn't do anything when there are no events.

Hence the busy-loop.

Adding a thread::sleep at the end of that loop seems to alleviate the issue.

knz avatar Aug 30 '20 20:08 knz

Not sure it is the same, but we also have a case of one instance running at 100% CPU on ubuntu 20.04, but in our case we found out it was because the folder /opt/beamium/sources/ had a huge number of files (>200'000); we deleted all them, restarted beamium and it seems to be back to normal

GregOriol avatar Dec 04 '20 21:12 GregOriol

No Greg that is a different issue. Your issue is because of a large number of files causing a lot of stat() operations. The issue above is a bug in the source code which causes a busy loop doing absolutely nothing other than eating up CPU.

knz avatar Dec 05 '20 12:12 knz