Deload Ram Memory Feature

I would like to request a feature to deload the ram memory

Something like the action to Change to a New Scene, that kills the memory usage but keep all the global variables intact.

For any larger and longer games that may overuse ram to be able to deload it as if the game had been closed and reopened.

I just tested the new release of Gdevelop and the ram usage is pretty good.

Thanks for that fixing

I still have the same problem, I figured out it wasn’t ram

I have no idea what to do

I cut by over 90% my global variables just to test
I did change the game from single file to multi files when save
I limited the fps to 60

I still have the problem

I notice the fps stays a lot of time from 60 to 120 fps when it is “slow” so I figured out the preview is just freezing unfreezing and it looked like slow

I’m using a M2 mac with 16gm Ram

but the exactly same issue happened when I was using a Linux with AMD9 40gb Ram and 6gb Vram

the freezing begins when I switch scenes multiple or sometimes few times

Does this happen in your builds too? Or just the preview?

the Preview

I never exported the game

I took some photos of the task manager before and after the “freezings”

the new Gdevelop 5.3.181 have better performance for sure, but this problem still happens

Before the crash:

After the crash:

this problem happens 99.9% of the time when switch scenes multiple times, it improved from 2 to 3 times to now up to 6

play time is not a problem, and dying and reentering the same scene is less bad, but maybe 10 times it begin freezing again

Show us the events you’re running when you enter a new scene / load a scene

the game has the map scenes like in donkey kong country
relugar levels you enter through the map (always change scene to)
and has menus and start scenes, a load or new game scene too

all the map scenes look like this:

the regular level scenes look like this:

all regular level scenes have external events for settings, objects manipulations
within the objects manipulation has my storage that I made through global variables way years ago before gdevelop added it, I chose to stay with my because I can manipulate it more

for each regular level scene a minumum of 300 global variable is triggered just for the storage
I once tested it with the storage totally disable and the global variables for it deleted

here is my global variables:

the one with 100 children is the storage, but has more childrens so its always 300+

also my core settings like resolution and zoom are managed by global variable and can be changed dynamically by the person just adjusting the window of the game

so I abuse the use of global and local variables

also my game file contain copy and paste from gdevelop 2018/2019 because its when I started

You’re not showing the conditions (at least I can’t see them on mobile). Are you taking advantage of “trigger once while true”? Otherwise a lot of events will just continue to run.

I use scene variables like this:

Condition: scene variable “start” is “0”
Actions: do the actions, then finish with scene variable start changing to “1” so it will never repeat

The same for objects

Only objects body parts after linked through variables, they keep triggering to keep them together while moving

Non moving objects I use something like
If bodypart is not = to body .X() then set bodypart to body.X()

I covered it pretty good back in 2019 when I used a old Intel Mac who would get hot if I didn’t did those things

For all new objects up to today I just copy and paste the events of a similar object and rename to the new object and do adjustments

I still used the “Always” special condition to keep fast moving objects together with their body parts

I use a variable named start or startbody1 startthestars staranything since a while, I never used the trigger once while true

All the objects uses this style of condition/action start123 so they never overdue, their body parts the same and the body parts of the body parts the same

All the scenes use the same style, it impedes overtriggering but I have more control over everything, but I end up with an excess of variable usage

99.9% of my scene variable are created in events, the scene itself usually has very few variables

sorry sadako, I wish I could help but this is way out of my league so to speak.

hope somebody with more knowledge can help you soon, I know how frustrating it is to go on without any help when you’re stuck.

It’s ok

I will wait :slight_smile: