riot icon indicating copy to clipboard operation
riot copied to clipboard

High CPU Usage

Open leostera opened this issue 11 months ago • 6 comments

This issue got reported first here https://github.com/leostera/minttea/issues/38 – but Github doesn't let me transfer an issue across organizations.

Possible culprits:

  • [x] #71
  • [x] #72
  • [ ] timer usage is spiking CPU usage

leostera avatar Mar 05 '24 10:03 leostera

Can confirm, I also have this problem:

Riot 0.0.8 from opam, OCaml 5.1.1, Linux (I can give more sys information if you need)

tjdevries avatar Mar 06 '24 17:03 tjdevries

I was also able to reproduce on OCaml 5.2.0~alpha (altho the memory usage looked better!)

tjdevries avatar Mar 15 '24 20:03 tjdevries

From what I can tell so far, something is happening with blink to make it happen (we can chat on discord more if you want)

tjdevries avatar Mar 15 '24 21:03 tjdevries

OK, maybe it's not blink, I'm very confused haha, i can send you link in VOD to watch if you have any ideas

tjdevries avatar Mar 15 '24 21:03 tjdevries

Thanks @tjdevries for the context and comments! ✨ I've been digging and found 3 specific things that could've be responsible. 2 of those are now fixed.

If you have code examples that I could try that would help me narrow down on the 3rd or others.

leostera avatar Mar 21 '24 20:03 leostera

Hey @leostera, I was looking into this, and from what I can tell it seems to be caused by having multiple schedulers, and one of the schedulers ending up with a list of skippable messages. It's non deterministic though.

I tested using 2 schedulers and 10 spawned processes. Every once and a while a scheduler gets stuck spinning on a mailbox full of skippable messages. I am trying to dig in more, but don't fully understand the architecture yet.

charleslambert avatar Apr 25 '24 18:04 charleslambert