-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DotRecast creating a lot of RcSpan objects for a relatively small scene. #66
Comments
Hello, The problem seems to stem from RcBuilderResult referencing many objects. We're currently working on optimizing RcSpan. |
Thank you kindly! |
@bryanedds Inspired by the recastnavigation source code, I added the keepInterResults option. You will be able to see that it significantly reduces memory usage. |
I don't think this change set helps us because none of the changes touch our actual use path. Here's how we use DotRecast currently - We use the Am I missing something? |
9777751 - Added the keepInterResults option to RcBuilder.Build() fixed!! |
Thank you, this should work better! |
I'm in the memory profiler today checking in on my program and was surprised by the number of objects that DotRecast is creating and keeping live for what might be considered a relatively small scene -
Here you'll notice we have 500k live instances of RcSpan -
Is there any change we can make to DotRecast or our usage to reduce the object count footprint here? Maybe a different internal representation or perhaps a posteri pruning? Or perhaps there's a reference from the mesh construction process I can let go of? I currently keep a reference to RcBuilderResult so I can draw the above debug lines. Should I not hold on to that? If so, would there be a better way to draw debug info for the nav mesh than using RcBuilderResult? If not, can I prune RcBuilderResult somehow?
Since we're dealing with realtime games, we'd like to keep the GC sweep phase as cheap as possible.
Lastly, here's the related issue I filed locally -
bryanedds/Nu#774
Thank you for your greatly helpful project - it has already saved us tremendous amounts of time and effort!
The text was updated successfully, but these errors were encountered: