2.0.0a8 - Mother of all GC collections Bolt2

Finntroll 2 years ago updated 2 years ago 6

When opening a fresh projects with alpha 8 unity makes a monstrous GC every ~10 sec:

Steps to replicate:

New Project:

1. 2019.3f5 + Alpha 8

2. Human naming

3. Create and assign class flow graph.

4. Take one of the exisiting start/update objects drag around the screen for a couple of seconds

5. Unity editor completely freezes for a long time.

I have seen others complain about this on discord.

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2
Satisfaction mark by Finntroll 2 years ago

This has been a long-standing Editor issue for undetermined reasons, it was fine and then suddenly it wasn't. Likely because Unity changed something but they're not saying what: https://support.ludiq.io/communities/5/topics/2420-periodic-hiccups

Long story short, Lazlo plans to refactor the Unit DB to take considerably less memory. https://www.notion.so/LiteDB-for-Extracted-Databases-147e0dc884234a86ac505761e5f06959

Meanwhile, you can enable incremental GC collect in Project Settings under Player. That improves the experience significantly. 

Thanks, and great answer. Incremental does indeed make it less obvious. But its painful to see the spikes in the profiler when trying to fix other profiling issue.

Fixed (Unreleased)

Hi Finntroll,

That GC collection issue seems much worst than the known one, however.

I believe it might be because 

a) You have domain reload skipping enabled

b) You ran a Full Extract

This means that all options from Bolt get fully extracted/loaded at once, and never unload because the assembly never reloads. 

You could significantly reduce the GC pressure by restarting Unity or by re-enabling assembly domain reload and entering play mode.

However, in Alpha 10, I'm bringing optimizations to this area.

Namely, after a Full Extract, the extracted units will not be kept in memory, and will therefore lazy-load from disk as needed. This should avoid the kind of enormous spikes you're seeing right now.

Ultimately, as TowerCrow pointed out, our goal is to once again rewrite the unit options database to avoid any kind of pre-emptive loading and memory pressure.

Thanks Lazlo, will try again after A.10.

Confirmed fixed in A10. My main issue was that it showed up in playmode, this seems to not be the case anymore. Also the editor does not freeze.

The fuzzy finder is quite a bit slower though, searching for something like "nav mesh agent des" takes ages.