ray icon indicating copy to clipboard operation
ray copied to clipboard

High CPU usage and memory leak?

Open D-nov opened this issue 11 months ago • 7 comments

Describe the bug When ray is left to run for few days in a row (3 days in this case) i noticed 2 things. 1 - A 43 GB syslog (/var/log/syslog) file full of logs about ray timeout / infinite loop ? - I don't remember the exact message because i was in hurry to free up system disk space 2 - High CPU usage, this morning when i check why the PC was still slow after freeing the disk space from the log file seemed like 94% of the CPU was occupied by Ray app when it was not even logging anything at that time.

Versions 2.8.1 (latest app image)

To Reproduce Steps to reproduce the behavior:

  1. Use ray
  2. No idea how proceed forward. Maybe dump something huge or enter infinite loop with a ray dump in it ?

Expected behavior Do not allow leaks and prevent log file to grow over 1gb of size

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu 24.xx

Additional context Is this the ray app repo or is ray.app the app repo?? Your repo naming is confusing.

D-nov avatar Jan 14 '25 07:01 D-nov

I've noticed the same thing on my Mac Mini M4. Ray is just idle and it uses a lot of CPU.

afonic avatar Jan 28 '25 09:01 afonic

noticed high CPU after 1 hour on 2.8.1

MacOS 14.6.1

dircm avatar Jan 29 '25 03:01 dircm

I had a very similar issue and when I reported it I was told that this issue has been resolved in the next version. So far, no notice on approximate dates fro the new release. It almost feels like Ray has been abandoned.

lcallif avatar Feb 23 '25 21:02 lcallif

Hi, Ray certainly has not been abandoned. We're ramping up development for a new major version that we'll release later this year. This release will have a modernized foundation in which these memory problems will be solved (hopefully) permanently.

That being said, we do maintain the current version as well. This particular memory / CPU is particularly elusive. For most Ray users the app works perfectly. And we also have a hard time replicating the issue internally (I'm not saying it is non-existent).

As soon as we have a reliable solution, we'll release it. Apologies for any inconvenience.

freekmurze avatar Feb 24 '25 08:02 freekmurze

I'm running into this right now. @freekmurze Is there anything I can do to help you debug this, like provide logs or something similar? For me, it only occurs when the app is running for a longer period.

siegerhansma avatar Apr 01 '25 10:04 siegerhansma

I'm running into this right now. @freekmurze Is there anything I can do to help you debug this, like provide logs or something similar? For me, it only occurs when the app is running for a longer period.

i'm pretty sure for all of us happens when it runs longer...

ghost avatar Apr 01 '25 11:04 ghost

There's definitely an issue with Ray regarding CPU usage and even energy impact on my M3 Macbook Pro:

See my response here: https://github.com/spatie/ray/issues/777#issuecomment-2810023129

UVLabs avatar Apr 16 '25 15:04 UVLabs

I just have a habit at this point of consciously quitting the Ray app (on mac m4) whenever I'm not using it. leaving it open and idle will eventually bog things down, it's not about the quantity of data being received

omegabenefits avatar Jul 19 '25 08:07 omegabenefits

I confirm that even on Windows, Ray keeps the CPU constantly high.

f-liva avatar Sep 21 '25 07:09 f-liva

It seems the issue is even worse on Tahoe, as it runs on Electron 17.4.11. Versions 35 of Electron and up have this issue solved.

octoxan avatar Oct 21 '25 19:10 octoxan

We're working on a new version of Ray that runs on the latest Electron version. This new version should address some of the performance issues you are seeing with today's version of Ray. More info: https://myray.app/blog/sign-of-life.

DriesH avatar Oct 22 '25 08:10 DriesH

@DriesH awesome, can't wait to see what you've got cooking! Wish there was an option to upgrade my yearly license to lifetime just to get the beta sooner hah. Thanks for sharing this update!

octoxan avatar Oct 26 '25 15:10 octoxan

You can now download the Ray v3 beta in which memory management is vastly improved.

Feel free to try it out, and let us know if this fixes the memory / load issues for you.

freekmurze avatar Nov 20 '25 14:11 freekmurze

I'm going to close this one for now.

Should this still be a problem in v3 beta, please report it here: https://github.com/spatie/ray-app-v3-beta

freekmurze avatar Nov 21 '25 10:11 freekmurze