How to turn garbage collection off?

Is there any way to turn the garbage collector off? It’s a huge turn off for people who want to optimize.
Thanks in advance for any advice. Hope this gets a solution soon.

EDIT 1:
Removed rant.lol

Start UE4 application (this includes editor) with -NoVerifyGC option

So if i understand correctly i would go to the directory where ue4 is in command prompt and just type in “UE4Editor -NoVerifyGC”? huh i should look for a list of options… maybe there’s some other argument i could use. but i appreciate the help and if this works i’ll quickly give you the answer and +1:)

crap i can’t find any signs that this argument is even working. i’ll need a little bit to setup a good test to benchmark this. but in the meantime +1 for trying to help. will report back with the results in a day or so.

Well check this out

You can disable object from auto deleting by adding it to root

This looks very useful. and from what i’m seeing it appears that the garbage collector won’t even realize there’s another object being created… therefore there’s no extra references attached to the object and the garbage collector won’t even check for it. This is gold. Thank you very much. also to the thing mentioned in your answer i’m starting to think that’s a link option i’m supposed to add. It looks a lot like it.

I’m just now getting into using gcc(despite already knowing asm) so that did throw me off a bit.

This answer is incorrect and should be marked as such. Unfortunately, I don’t yet have enough rep to downvote it. -NoVerifyGC does NOT turn off garbage collection.

Some objects are marked as “disregard for GC”; these objects are assumed to not reference any objects outside of their group, which allows the garbage collector to work more quickly by ignoring those objects during certain parts of the collection routine. Development and editor builds will double-check these objects anyways - this is called “GC verification”, because it verifies that the assumptions are correct. The NoVerifyGC flag skips that safety check in dev builds, making them behave like shipping builds in terms of this particular subsystem.

In short NoVerifyGC says “assume that everything is peachy with our disregarded objects, don’t bother double-checking for references because your double-checking is messing with my profiler”.

1 Like