Loading multiple Assetbundles causes a Crash

Good evening,

I have the following problem:
when I load an assetbundle, and then i unload everything from it and load another one and so on, mabye i only switch between 2 assetbundles the app after a while 20-30 trys on nexus 10 and a bit more on Nexus 5 crashs… but I have no Idea why…

First i thought it could be the Memory… but i checked everything with the profiler and it looks ok.
I get a Signal 11! This is a small part of it:

    #01 pc 003c9b38 /data/app-lib/com.xx.xx-1/libunity.so (std::basic_string<char, std::char_traits, stl_allocator >::operator=(char const*)+20)
    #02 pc 003ca314 /data/app-lib/com.xx.xx-1/libunity.so (MemoryProfiler::RegisterRootAllocation(void*, BaseAllocator*, char const*, char const*)+108) 
    #03 pc 000b2958 /data/app-lib/com.xx.xx-1/libunity.so (set_root_allocation(void*, MemLabelId, char const*, char const*)+72)
    #04 pc 001e0454 /data/app-lib/com.xx.xx-1/libunity.so (WWW::FeedUnityWebStream(bool)+480) 
    #05 pc 004b4d34 /data/app-lib/com.xx.xx-1/libunity.so (AndroidWWW::ReadCallback(void*, void*, int, void*, int)+200)

 `

Thanks
`

i tryed to reproduce this with 2 assetbundles with a cube and a sphere, but there after 200-300 trys nothing happend. It crashs using 10-15mb big Assetbundles with shader, materials, textures and meshes with gameojbects and so on. I'm using Unity 4.2.0f4 and a Android 4.4.2

Are you properly unloading and garbage collecting everything? If you're just using a straight loop, you may have to throw a System.GC.Collect() in there to force it to clear up leftover assets.

Thanks a lot for your tipp. Im not using collect yet, i will post a snippet of my routine and try to use collect. Thanks a lot

i tried to add the Collect, but it is still crashing. Im Loading the Assetbundle in a Courutine... but that shoudent be the problem. Thanks anyway

I have this problem as well on Unity 4.5.1. Did you find a work around?

1 Answer

1

Had exact same issue on our game. We were loading/unloading about 15MB of assetbundle per level, and unity client crashes frequently(depending one device, galaxy s4 lasts about 15 levels, nexus 7 lasts about 35 levels). Log indicates “signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000” and . Spent almost 100 engineering hours trying to find the issue. It finally comes down to replace "new WWW() " with “WWW.LoadFromCacheOrDownload()”. It’s apparently a Unity bug but they refused to fix it.