Search Issue Tracker
Won't Fix
Won't Fix in 2019.4.X
Votes
0
Found in
2019.4.32f1
Issue ID
UUM-2167
Regression
No
Profiler reports nonsensical allocation callstacks when calling native Android methods (especially on IL2CPP)
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:
- MediaPlayer.Update() calls AndroidMediaPlayer.Update()...
- ... which calls AndroidMediaPlayer.UpdateTimeRanges() (amongst other things)...
- ... which calls AndroidJavaObject.Call() (https://docs.unity3d.com/ScriptReference/AndroidJavaObject.Call.html) ...
- ... and both AndroidMediaPlayer and AndroidJavaObject (disassembled and viewed in Rider) call various methods on AndroidJNIHelper (https://docs.unity3d.com/ScriptReference/AndroidJNIHelper.html) which use StringBuilder and reflection.
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.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The Scrollbar becomes unusable when adding Elements to the List
- "One or more data file missing for baking set NewScene Baking Set. Cannot load shared data." error in Player when a specific project is built
- Choosing new HDR Colour using RGB values breaks colour on Intensity Selectors
- Rendering/Decal Layer Mask options are different inside Prefab Mode and outside Prefab Mode when the project is upgraded to Unity 6
- Incorrect Realtime GI Light Probes baking when more than one Light Probe Group is used and "Baked Global Illumination" is enabled
Resolution Note:
There are no fixes planned for this Bug
Resolution Note (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.