YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
24 stars 8 forks source link

In-Game: [HTML5] Memory leak and performance issues when updating "depth" values of instances #7624

Closed gm-bug-reporter[bot] closed 1 month ago

gm-bug-reporter[bot] commented 1 month ago

Description

Memory leak and performance issues on HTML5 export when updating depth of instances. Here is the code that caused the issue. There were about 20 instances in this list. When the room was exited, the memory was returned and the CPU usage dropped back down. Not a problem on windows export.

// Step Event if (ds_list_size(deck) > 0) { var i; var s = ds_list_size(deck); for (i = 0; i < s; i++) { deck[|i].y_offset = i; deck[|i].depth = -i; } }

Steps To Reproduce

  1. Start GameMaker
  2. Add the attached line of code in a step event.
  3. Populate the ds_lists with 20+ instances
  4. Export to HTML5

Which version of GameMaker are you reporting this issue for?

IDE v2024.6.2.162 Runtime v2024.6.1.208

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

Windows 10.0.19045.0

Which platform(s) are you seeing the problem on?

HTML5

bb92dd07-a272-4e9f-951b-d67ae7b0624c

nickwveith commented 1 month ago

I submitted this bug and wanted to add some additional info.

In addition to setting the depth each step with the above code, the instances themselves were also resetting their depth to 0 in their step events. So it was flickering between 2 depths each frame and not just maintaining a single depth. Not the best code but still shouldn't leak memory.

jackerley commented 1 month ago

Duplicate of #7608