Possible memory leak

I’ve traced down a huge memory leak that’s in my game to pathfinding. If I disable enemies from moving then the memory does not spike. It seems to be an issue primarily after going through scene changes. We have a procedural dungeon system that uses a grid graph. After going through ~10 floors or so the memory usage goes up 1gb. I disable that method that allows movement on the enemies and it does not. Is there anything I should be doing between scene changes? Note: going to a new floor causes the scene to reload.


Try the latest beta, I have recently fixed a bug which could cause pathfinding threads to sometimes not be terminated correctly (and thus leak memory).

Thanks, I’ll look into that likely tomorrow. I did find something a while back with “leaking” coroutines. If I was calling start path on the seeker frequently it would have background coroutines going on that exponentially grew to be many many thousand calls per frame. I had to make sure stop all coroutines was being called before starting a new one. Not sure if that’s related.

What coroutines were leaking?
I am not aware of any coroutines that are started by calling the seeker.

It was due to the follow script that I based mine off of from one of the examples. Yours was designed to use a target transform to move to, but I was simply just calling startpath and allowing the onpathcomplete to occur to start the movement. This was causing the Repth/WaitToRepath coroutine set to grow and grow. It was the “AIFollow” script.