Reply To: MonoManager Memory Allocation

NodeCanvas Forums Support MonoManager Memory Allocation Reply To: MonoManager Memory Allocation

#14961
Gavalakis
Keymaster

Hello again,
Thank you for the profiler data; that was helpful.
Some of the allocations happening here are unfortunately unavoidable, while others can be improved. For your information:
1) When using the AutoCast feature with structs (AutoCasting a struct variable to a task parameter that is not of the same type), then allocation can’t be avoided because the variable needs to be value boxed (which creates allocations). Thus while the AutoCast feature is convenient, it also allocates.
2) When Enabling/Disabling a Sub-Graph node, there is some allocations for writing/reading the mapped variables if any and for enabling/disabling the subgraph. I think I will be able to improve this.
3) When using CheckEvent condition, every time the CheckEvent condition is enabled/disabled, it allocates because it subscribes/unsubscribes to a c# event (in EventRouter). Subscribing/Unsubscribing to C# events in itself creates allocations. I can probably improve this by changing the sub/unsub to a custom implementation.

All allocations in your sent profiler data stem from those. The biggest hits are from # 2 and #3. Since #3 is possible to take place more often in a graph, thus I will check this out first for an improvement, but I will also check #2 out of course. #1 is unfortunately still unavoidable though, although the allocations are smaller (30B-60B).

Thank you!

Join us on Discord: https://discord.gg/97q2Rjh