Hi guys, i have a project always crash because of a large memory usage, when i try to handle this i meet some problems. I wish someone could help me.Thanks in advance.
1.I have a PNG Texture(3850 * 960, 1.25MB), when i import it to unity3d and set the properties in inspector as follows: Texture Type:GUI, Format: TrueColor, then click apply, it shows 14.1MB in preview window, what does 14.1MB mean? Is it the memory usage of the texture when it’s loaded to memory?
2.I create a .unity3d file with the texture mentioned above and create an asset bundle from the .unity3d file, then i use assetbundle.Load() to load the texture, i track the change of memory usage with the Profiler - Memory - Detailed, i find that once assetbundle.Load() is triggered the memory usage will increase by 28.3MB. I want to know why 28.3MB and not 14.1MB?
Assetbundles are loaded entirely into memory before loading any requested asset. Assuming you only have the one 14.1MB texture in your bundle, the memory usage will be 2 x 14.1MB = 28.2MB.
Assetbundles as a system is very poorly designed. The memory usage and lack of automatic content manifests make them incredibly inefficient and unwieldy. Enough people have provided feedback to UT and hopefully they will do something about it in time.
When loading large assets, say 50MB+, if you are already running with a game memory footprint of 1.5GB+ and/or have a fragmented heap, loading such assets can lead to large heap errors and out of memory exceptions.
Thank u very very much.
Then i have another question and wish for your help. When an assetbundle is created, Profiler - Memory - Simple shows the memory usage increases by 14.1MB, but Profiler - Memory - Detailed shows no change, why are they different? And the most incredible is that when i track the memory usage with Profiler - Memory - Simple, after creating assetbundle, the memory usage increases by 14.1MB, then i trigger assetbundle.Load(), the memory usage increases by 28.2MB additionally, so the result is 14.1MB x 3?