- Joined
- Mar 28, 2016
- Messages
- 1,623
- Reaction score
- 1,439
- First Language
- French
- Primarily Uses
- RMMV
This is just a little tricky tutorial to unlock the control of gc and optimise performance to avoid gc release at random position in your game.
this is a typical example from what you don't want, when people play your game.
During the game, the GC release a majors memory and make a big spike lag at random time.
Example here, ~5 seconds after scene transition, a big lag.

Solution.
Add flags
this will unlock you the command window.gc inside your app.
Than call window.gc() between a scenes or after a big loading or a (transition scenes).
This allow to fully controls and force GC where your want and avoid big major GC release at random time in your game.!
No more random spike lag random ~5 second after scenes transition, but all inside the fading scene transition.

enjoys !
more info
The flag
should also allow you set max memory.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management
this is a typical example from what you don't want, when people play your game.
During the game, the GC release a majors memory and make a big spike lag at random time.
Example here, ~5 seconds after scene transition, a big lag.

Solution.
Add flags
HTML:
"js-flags": "--expose_gc",
Than call window.gc() between a scenes or after a big loading or a (transition scenes).
This allow to fully controls and force GC where your want and avoid big major GC release at random time in your game.!
No more random spike lag random ~5 second after scenes transition, but all inside the fading scene transition.

enjoys !
more info
The flag
Code:
--max-old-space-size=6000
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management
Attachments
-
629.6 KB Views: 4
Last edited:
