- Home /
Memory leak with Streaming terrains
I've modified the streaming world example to Work with Unity free on Android basic. It basically uses loadLevelAdditive to load the maps that I've packed into the player, not as AssetBundles. When unloading a Zone, I simply GameObject.Destroy() the root object in that map.
The game runs fine initially but after several levels are loaded and unloaded, the application memory size keeps piling up to an eventual crash. In the original example project, I think AssetBundle is unloaded after every level is loaded additively, taking care of any memory occupied by it. Here, I believe that the level and its objects, like terrain are never unloaded even after I've destroyed everything loaded from that level.
Is there a way solve this issue?
Is it possible to load and unload entire scenes using Resources.Load and Resources.Unload ?
I've just purchased both Unity pro and Android pro to use AssetBundles. Now my ZoneLoader script is basically the same as in Strea$$anonymous$$gWorld demo. Sadly, the problem persisted. Even after using AssetBundles and unloading out of range zones, memory keeps piling up and app crashes eventually. I think terrains are not freeing up memory at all.
Your answer
Follow this Question
Related Questions
Do I need to manually call Resources.UnloadUnusedAssets? 0 Answers
Streaming Audio in WebGL 1 Answer
Clearing Editor References when Building for Mobile 1 Answer
Prevent Resources class from loading assets when application starts 1 Answer
Animations loading on Android requires double memory size. 0 Answers