YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
13 stars 5 forks source link

Performance: Reopening a project from Recent Projects does not appear to clean up fully #5873

Open YYDan opened 2 weeks ago

YYDan commented 2 weeks ago

Description

When looking into #5870 I saw that reopening a project from File > Recent Projects does not appear to clean up fully and so you gain 10-15MB of RAM usage each time.

DanRAMRecentProjects.zip

Expected Change

No response

Steps To Reproduce

  1. Start GameMaker and create a new project from the Platformer template, save the project, then close GM
  2. Restart GM and open that project you just made
  3. Observe that immediately after the project has loaded you will be somewhere around 220-225MB of RAM
  4. Allow GM to idle for a minute and observe the usage will slowly drop until you get to about 205MB, where it becomes constant
  5. File > Recent Projects > pick this project again from the top of the list
  6. Observe that immediately after the project has loaded you will be somewhere around 225-230MB of RAM, but this time if you let GM idle the usage does not drop over that minute or so
  7. Repeating step 5 gets you up to a constant 240MB-ish, do it again and 250MB, and so on

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.4.0 (Monthly)

Which operating system(s) are you seeing the problem on?

Windows 10

Are you running GameMaker from inside your Steam library?

No

Contact Us Package Attached?

Sample Project Added?

gnysek commented 1 week ago

What I and at least 2 other persons discovered is that when reloading projects very often, sometimes Code window for events is re-set to 0px, so on next opening they're becoming 400px wide:

obraz

What I found is that this is caused by 0dpi_px in: <DocumentWindow columns="1" fullscreen="False" activeTab="0" isActive="False" w="0dpi_px" h="593dpi_px" linkIndex="-1">

While this is rather not causing memory leak, it might be connected to something that is still residing in memory and writing data AFTER project is closed (and because same one is opened, layout data/window size is being read/saved in wrong way).

We yet not found a way to reproduce this, however this happens for me when I was doing lot of reloading from Recent Projects trying to reproduce another memory leak. If I would find a way to reproduce this, I would add separate issue.