TurboWarp / desktop

A better offline editor for Scratch 3.
https://desktop.turbowarp.org/
GNU General Public License v3.0
361 stars 73 forks source link

Memory issues #968

Open hamster6421 opened 5 months ago

hamster6421 commented 5 months ago

My game, which I've been working on for two years, has issues where after playing the game for a while, it runs out of memory and it crashes (this is in the packaged version). It seems that there's a small increase in memory usage every time a new level is loaded, but the usage builds up over time and old assets are never unloaded and it eventually crashes. I've been trying to fix this for around a month and at this point, I've basically already tried everything I can think of to fix the issue, and it helped a little, but nothing has fixed the overall issue. Do you know of any way to fix this?

Also, I do have a good computer (16 GB RAM), and the project is about 340 MB.

GarboMuffin commented 5 months ago

what are you using to load levels? an extension?

GarboMuffin commented 5 months ago

I guess you wouldn't need an extension to see that either, just loading costumes, yes once loaded they currently never get properly unloaded

hamster6421 commented 5 months ago

So do you know a way for me to make my game crash less?

MeowieGamer commented 5 months ago

I also work on this game. My computer has 32GB of ram, and even still, the project can manage to crash it. We're unable to count the game "finished" until this memory leak is resolved (which, at the moment, might be never, which sucks because we've put our heart and soul into the game.)

I have screenshots of the issue below. The first is after 5 minutes of gameplay. The second is after 10 minutes. Screenshot_20240417_175248 Screenshot_20240417_180047

Sussy-OS commented 5 months ago

I also am part of Meowie Games, and just having the game open for a few minutes, my memory already went from 11.6 GB to 15.2 Will update if crashes. Edit: 16 GB now as of 15 minutes after original message

ghost commented 4 months ago

@GarboMuffin That'd probably make a good extension idea, using a block to load/unload sprites, costumes and sounds, though it'd be really difficult to get something like that somehow working.

ghost commented 4 months ago

I also am part of Meowie Games, and just having the game open for a few minutes, my memory already went from 11.6 GB to 15.2 Will update if crashes. Edit: 16 GB now as of 15 minutes after original message

By leaving the green flag on idle? or just having turbowarp open in that project and not touching it.

Sussy-OS commented 4 months ago

I also am part of Meowie Games, and just having the game open for a few minutes, my memory already went from 11.6 GB to 15.2 Will update if crashes. Edit: 16 GB now as of 15 minutes after original message

By leaving the green flag on idle? or just having turbowarp open in that project and not touching it.

In my case, I just played the game as usual.

ghost commented 3 months ago

I think it might have to do with the project player converting the svg's into regular images, but for some reason it doesn't get correctly deleted when it has been edited or when it has to be rerendered when you go in and out of fullscreen and ends up just staying in memory and not being cleaned out, which would explain why Turbowarp slowly takes up more RAM and ends up getting laggy expecially when doing anything with the poject player.

hueychen27 commented 3 months ago

Same issue for me. This destroys my CPU to almost 100% after some minutes spent in the Turbowarp desktop app. This happens sometimes when I am not even doing anything with the project stopped (after I have loaded my relatively large project)