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. Dismiss Notice

Sprite packer running out of memory

Discussion in '2D' started by JMEA, Jun 10, 2014.

  1. JMEA

    JMEA

    Joined:
    Sep 27, 2013
    Posts:
    23
    Anyone else seeing issues with the sprite packer in 4.5.0 running out of memory?

    I have about 200M (compressed) of sprite data representing a few thousand sprites. The Sprite Packer will cause Unity to use more than 3.0GB and often crash. All of my images get packed into about 8 4096x4096 sheets.

    Anyone else seeing this, or know of any work arounds? It happens on Mac and PC. I believe it is going over the 32-bit addressable space limit
     
  2. TomasJ

    TomasJ

    Joined:
    Sep 26, 2010
    Posts:
    256
    Do you use a custom packing policy?
     
  3. JMEA

    JMEA

    Joined:
    Sep 27, 2013
    Posts:
    23
    Yes, looks like the issue was using AssetDatabase.LoadAllAssetsAtPath (from the old example) instead of AssetDatabase.LoadAllAssetRepresentationsAtPath

    Fixed now, thanks
     
    TomasJ likes this.
  4. smoggach

    smoggach

    Joined:
    Feb 13, 2014
    Posts:
    9
    How did you fix this? I'm having the same problem. I tried using the new policy example code and it still won't work.
     
  5. JMEA

    JMEA

    Joined:
    Sep 27, 2013
    Posts:
    23
    Still isn't fixed for me either, but I can run it once without restarting. They need to fix the memory usage of the packer or ship a 64 bit editor.

    I imagine there are leaks on the Unity end
     
  6. TomasJ

    TomasJ

    Joined:
    Sep 26, 2010
    Posts:
    256
    Which version are you running? We've made improvements in 4.5.2p1, see http://forum.unity3d.com/threads/unity-patch-releases.246198/
     
  7. JMEA

    JMEA

    Joined:
    Sep 27, 2013
    Posts:
    23
    I have not tried 4.5.2p1 yet, I'll give it a shot