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
- Shader Graph Swizzle Node Input/Output and Mask Update Incorrectly After Undo
- [URP] Crash on GameObject::QueryComponentByType when baking a Reflection Probe in an unsaved/untitled Scene
- No Icons are used for the Entry and Exit States in the Inspector when selected in an Animator Controller
- Crash on PlayerMain(int, char const**) when exiting Standalone Player with a Particle System in the Scene
- No Icon is used for the Runtime Animator Controller Type in a Search Window when assigning an Animator Controller in the Animator Component
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.