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
- Created asset is placed in a new folder when creating a new folder and instantly creating an asset by clicking somewhere else
- Selecting and deleting transition in Animator does not add to Undo History when animation is previewed in Inspector
- GameObjects remain static when updating constraints of PhysicsJoint with "Enable Sleeping" selected in Havok Physics Configuration
- [iOS] Touch input is not clocked and UI is unresponsive when the application is paused mid-drag without lifting the finger
- [sw-unity-6-1] Scene view renders any light differently when more than one camera exists and neither have the "MainCamera" tag
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.