ncsoft / Unreal.js

Unreal.js: Javascript runtime built for UnrealEngine
Other
3.69k stars 351 forks source link

Garbage Collection takes a long time in 4.18 #212

Open xKamuna opened 6 years ago

xKamuna commented 6 years ago

When the plugin is loaded, not even when it is actually used, UE4's garbage collection system stalls every time it performs reachability analysis during gameplay. Any ideas to what could be causing this?

keicoon commented 6 years ago

It's not easy problem. UE4's GC is not move according to your operation. But, you can control a portion of the GC. One of them is that make uobject to root object not included in gc target.

thejustinwalsh commented 6 years ago

See https://answers.unrealengine.com/questions/493997/best-way-to-avoid-uobjects-garbage-collection.html for more info. You could potentially modify the plugin itself to add UObjects to the root set to skip GC. Additionally you can launch the game with the command line -NoVerifyGC to skip verification and reduce hitching.

xKamuna commented 6 years ago

-NoVerifyGC didn't do anything when I tried it. It didn't happen in 4.17, but it happens even on a blank project in 4.18. I'm not using the plugin right now, but at that time I wanted GC used in the game.