Hello Guest

Author Topic: Unloading texture assets from memory  (Read 3694 times)

JReanne

  • Newbie
  • *
  • Posts: 8
    • View Profile
Unloading texture assets from memory
« on: September 24, 2014, 09:32:47 pm »
I apologize if this has been covered before - I've been reading through the forums and found some relevant threads, but still haven't been able to get this figured out.

I'm optimizing my iOS game built with Unity and 2d Toolkit, and running into some memory issues.  The texture assets that are loaded in any given scene don't seem to be unloaded when I jump to a new scene.  Here are some of the permutations I've tried:

Scene A -> Scene B: While in Scene B, texture assets from both A and B are in memory
Scene A -> blank scene -> (additive load) Scene B: same result as above
Scene A -> blank scene: texture assets from scene A are still in memory while I'm in the blank scene

When I say "in memory", I mean that I'm using the Unity profiler while running the game on my iPad, and selected a Detailed Sample of the memory so that I can see exactly what's there.

Thank you in advance for any help!
Best,
Jenna

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Unloading texture assets from memory
« Reply #1 on: September 25, 2014, 12:06:18 pm »
It should be unloaded. There is no link / dependency to anything at runtime (there is in the editor, and it sometimes may not unload correctly in the editor). What tk2d features (png, multi atlas spanning, platforms) are you using? Do you have any prefabs / gameobjects set to DontDestroyOnLoad?

Failing that narrowing it down, can you create a repro for this please?

JReanne

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Unloading texture assets from memory
« Reply #2 on: September 25, 2014, 08:02:10 pm »
Ok, I think I've actually tracked this down to a Playmaker issue.  I'm still working on a repro case, but I'll let you know if it relates at all to 2dtk.