Large memory usage for small graph

I have a relatively small recast graph with a start cache which takes 3.1mb on disk. However, when loading into memory, astar allocates 124mb of memory which is quite a lot, especially on mobile. I have Scan on Awake turned off and am not scanning at runtime at all.

Is this normal, or could something be wrong? This is using 4.3.61. I can’t update further as I’m on Unity 2021.3 LTS.

Hi

The cache is only saving the minimal amount of data, and it is compressed on top of that. So it is expected to be significantly smaller than the loaded graph.

You can reduce the number of threads used by the pathfinding system to reduce memory usage a bit. See A* Inspector → Settings → Pathfinding → Threads.

That makes sense. Thanks!

1 Like