Support Forum

Memory leak, how to reset?

Hello,
I’m having a very specific case and my game is basically a simulation that need to run for hours
I’m using a Recast Graph, and some prefabs spawns every minutes and require a local compute of the graph via GraphUpdateScene component

However, the memory usage is getting bigger and bigger, I’ve profiled and seems that Pathfinding.Graphnodes was growing really fast.
I’ve tried to reload the scene every 30 minutes hoping that the some stuff would be garbage collected, it helped a bit but there is still a leak (approx 500mb/hour)

Is there any way to clean the memory or reset entirely the graph?

Thank you

Same issue, after scene reload memory is not getting released and every time game grabs ~500mb more in our game

Hi

Which version of the package are you using?

Hi,
I’m using version 4.2.15, I think it’s the current one

Hi

Sorry for the late reply.
What you could try is to use the beta version available here: https://www.arongranberg.com/astar/download. In the beta version the recast graph has been significantly rewritten and it’s very likely that this issue has been resolved there as well.