4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.54k stars 842 forks source link

Poor memory management when changing scenes causing permanent memory increase #5921

Open ZachjuKamashi opened 10 months ago

ZachjuKamashi commented 10 months ago

Is there an existing issue for this?

Describe the bug

There is a permanent memory increase after changing scenes with regarding events which can result in very high RAM usage in certain cases, enough for the project to run out of memory and even crash devices.

Here is a video showcasing how the memory usage performs with this test project.

https://github.com/4ian/GDevelop/assets/98941240/a9382f52-0431-4305-a4c2-8a20371108be

And here is the project file

Memory_leak-iter3.zip

Steps to reproduce

Instructions are within the Project

GDevelop platform

Desktop, Web, Mobile

GDevelop version

5.3.185

Platform info

Windows 10 Enterprise LTSC 21H2 OS Build 19044.1288

Additional context

No response

D8H commented 10 months ago

This is probably because the generated code is clearing object lists before the events instead of after them so some instances stays in memory until the scene is run again.

ZachjuKamashi commented 3 months ago

@D8H It's been half a year, are there any updates on solving this issue?