Search Issue Tracker
Won't Fix
Votes
0
Found in
2020.3
2020.3.18f1
2021.2
2022.1
2022.2
Issue ID
1386507
Regression
No
SerializedFile metrics show different memory costs when using AssetBundle.LoadFromFile and AssetBundle.LoadFromStream
How to reproduce:
1. Open the user's attached project
2. Open scene Scenes/SampleScene
3. Go to AssetBundle -> Build
4. Open the Profiler (Window -> Analysis -> Profiler) and record profiling information
5. Select the Memory tab and change the chart from "Simple" to "Detailed"
6. Press the Play button
7. In the Game view, select "unload bundle and unused assets" and "load bundle from stream"
8. In the Profiler Memory tab, select Take Sample, and observe the SerializedFile memory metrics (under Other)
9. Exit Play mode and enter Play mode again
10. In the Game view, select "unload bundle and unused assets" and "load bundle from file"
11. Repeat step 8
Expected result: SerializedFile shows no difference in memory cost between loading from stream and file
Actual result: SerializedFile shows that loading from stream costs 100-200KB more than loading from file
Reproducible with: 2020.3.26f1, 2021.2.8f1, 2022.1.0b4, 2022.2.0a2
Could not test with: 2019.4.36f1 (Unknown managed type referenced: [UnityEditor.CoreModule] UnityEditorInternal.Profiling.CPUProfilerModule)
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
- [URP] [Vulkan] Fantasy kingdom crashes editor when switched to Vulkan
- UnityException: get_disableApplyMaterialPropertyDrawers can only be called from the main thread
- DX12 Projects close and are not being created when creating XR Templates on an XPS 13 Arm Device
- Crash on GfxDeviceD3D12::AllocBottomLevelAccelerationStructure when using Raytracing
- The search icon in the "Searches" sections is blurry and inconsistent
Resolution Note:
The size differs due to the buffered reader memory consumption which appears in the case of LoadFromStream. Furthermore unlike LoadFromFile the buffered reader will keep memory around until the managed stream is disposed.