Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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