Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

AssetBundles and out of memory

Discussion in 'WebGL' started by FamerJoe, Oct 8, 2015.

  1. FamerJoe

    FamerJoe

    Joined:
    Dec 21, 2013
    Posts:
    193
    So I have a very basic project with a button that just loads an asset bundle (the asset bundle is small, like 130k).

    When press the button, the asset loads fine, and gets instantiated as a gameobject. I also have a kill button that destroys it. If I repeat the process, on the second or 3rd try, I get an out of memory error, which is strange because the memory shouldn't be growing.

    I'm using bundle.Unload(true); after I instantiate the asset, which I thought should free up any memory the actual downloaded bundle was using, and Destroy(go) to get rid of the object.

    Am I missing something? If I can load it once, shouldn't I be able to load it unlimited times?
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Can you look at the Memory Profiler to see where the memory is going (whilst running your content in the Browser)?
     
  3. FamerJoe

    FamerJoe

    Joined:
    Dec 21, 2013
    Posts:
    193
    I've had no luck getting the profiler working with WebGL with dev mode + auto connect profiler & firefox, sadly.
     
  4. FamerJoe

    FamerJoe

    Joined:
    Dec 21, 2013
    Posts:
    193
    Consistently getting "Sending message header failed" when I try to build & run with auto profiler
     
  5. FamerJoe

    FamerJoe

    Joined:
    Dec 21, 2013
    Posts:
    193
unityunity