Unity Issue Tracker - Profiler reports nonsensical allocation callstacks when calling native Android methods (especially on IL2CPP)
Closed
UUM-2167
Profiler reports nonsensical allocation callstacks when calling native Android methods (especially on IL2CPP)
Unity: Profiling
Won't Fix
2019.4.X
Unfortunately 2019.4 is not supported anymore, so we have to close the bug and see if we can repro or find a newer project that we can repro the issue with.
From examining a customer project that uses AVPro Video (https://renderheads.com/products/avpro-video/) for Android, trying to track down the causes of managed allocations in MediaPlayer.Update() by enabling Call Stacks in the Profiler. For context, examining the code shows that:
If the scripting backend is set to IL2CPP the call stack contains nonsensical information - for example, constructors from random unrelated classes within the project appearing to call each other. If it's set to Mono, the call stacks are somewhat better: they don't include the methods in AndroidJavaObject (inlined, perhaps?), but they do show the use of StringBuilder and reflection.
It would be useful to see more complete and accurate call stacks in this kind of use-case, particularly if IL2CPP is the scripting backend.
Issue seen in Unity 2019.4.32f1. We haven't tested to see how many other calls to garbage-generating Unity APIs result in mangled call stacks.
Prioritise and Follow this issue
Have a workaround or additional info about this issue?