the-marenga/sf-scrapbook-helper

[Bug] Huge CPU usage after crawling finishes

Closed this issue · 2 comments

Describe the bug
Program uses all of the CPU it can after the crawling finished (more than during crawling) and thread are set to 9

To Reproduce
Steps to reproduce the behavior:

  1. Start app and login to character
  2. Set threads to 9
  3. Wait for crawling to finish
  4. Don't change the threads back

Expected behavior
After crawling ends the CPU should not be used

Machine (please complete the following information):

  • OS: Ubuntu 22.04
  • Version 0.2.1 (commit 452b457 ) - self compiled

Additional context
The CPU is not used extensively during crawling. My CPU was ~4% used when crawling, 99.6% after it stopped. I have a good CPU.
Changing the threads back to 1 or 0 fixes the issue. This can be a fix - after crawling finishes just set it back to 0.

When threads are set to 1 CPU is used around 10%, jumps down to 3 again after setting to 0. Infinite loop?

Hmm... strange, each thread should just be doing a basic sleep for a set amount, if there is nothing left to do. I will have to look into that soon, thanks for the report!

Oh, yeah, jesus christ. It seems like I forgot to add a headless check at one point and that cloned and auto-saved the entire HoF to disk.. every few seconds... for every thread... for every character...

Big thanks again for pointing that error out!