Optimize and control garbage collector [gc]

Jonforum

Veteran
Veteran
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.
upload_2019-11-23_5-9-58.png

Solution.
Add flags
HTML:
 "js-flags": "--expose_gc",
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.

upload_2019-11-23_5-21-37.png
enjoys !


more info
The flag
Code:
--max-old-space-size=6000
should also allow you set max memory.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management
 

Attachments

Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,585
Latest member
Reversinator
Top