desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Memory issues

Open hamster6421 opened this issue 10 months ago • 10 comments

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.

hamster6421 avatar Apr 16 '24 02:04 hamster6421

what are you using to load levels? an extension?

GarboMuffin avatar Apr 16 '24 02:04 GarboMuffin

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

GarboMuffin avatar Apr 16 '24 14:04 GarboMuffin

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

hamster6421 avatar Apr 16 '24 20:04 hamster6421

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

MeowieGamer avatar Apr 17 '24 22:04 MeowieGamer

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

Sussy-OS avatar Apr 18 '24 02:04 Sussy-OS

@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 avatar Apr 25 '24 16:04 ghost

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.

ghost avatar Apr 25 '24 17:04 ghost

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.

Sussy-OS avatar Apr 25 '24 20:04 Sussy-OS

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.

ghost avatar Jun 09 '24 23:06 ghost

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)

hueychen27 avatar Jun 19 '24 02:06 hueychen27