Hi there,
I’m one of Scott’s work mates and the main author of our ECS, which is based by its nature on large struct arrays.
So we look forward to a fix for this case.
I was trying to use the memory profile quite a bit, but I still struggle to really understand the output it creates and concrete documentation about comparing memory snapshots is quite scarce.
So it wasn’t very helpful yet to find our memory leak(s), since there are many unknowns to make sense of the output of the snapshot comparison of “All Of Memory”.
The leaks occur due to loading and quitting the same level again and again, so I did snapshots after each level load for some loads.
To avoid any effects of lazy loading first time operations, I tried to compare the snapshot after second load with a later one.
What we see is a huge increase in the sub category “Untracked*”, a smaller increase of “Reserved”, and a small increase in “Managed” and the latter is even negative at times. As of yet we are unsure what this means.
Description shown when clicking on “Untracked*”:
Can you tell us more about this “Untracked*” type and what this what we see here actually means?
How can our code create so much untracked memory?
Obviously we tried to make use of the details viewed in the “Managed” category, but it doesn’t make much sense or maybe is even incorrect.
For example it found a “diff” on an array used in our terrain map between second and fourth level load.
If I understand the output correctly, then the tool tells us there wasn’t a terrain map in snapshot A(second load), but there is now one in the snapshot B (fourth load).
But this can not be true, since there will be always a terrain map or there wouldn’t be a game.
Almost all the diffs are based on such arrays popping out of nothing not recognized in the first snapshot but present in the second, while other disappear but should be there (or the game wouldn’t work).
So what is this “Diff” actually based on and how can it help in any way to find a leak?
We have an hard time to leverage the tool to help with finding leaks.
By just looking at the basic Profiler’s memory section instead, we could figure the leak could have to do with save game serialization.
The Memory Profiler - if it worked correctly, or it would be better understood by us - respectively, it seems it could be potentially a way better tool to find the leak, but so far we fail to interpret what it is actually telling us.
Any pointers on these questions would be much appreciated.