2D Toolkit Forum
2D Toolkit => Support => Topic started by: Companella on March 27, 2014, 03:25:30 am
-
Hi~
Please look at jpg.
I use LoadLevel to a empty scene. But the last scene used atlas0 didn't release, why?
Profiler marked "Referenced By: ManagedStaticReferences()", what's this ?
I never use any static variables.
-
I don't know what that is specifically. I wouldn't bother checking profiling in the editor, too many unknown things happen there for the profiler to be genuinely useful. You get much better results profiling the actual built executable.
-
Same situation in .exe and .apk
and profiler marked Referenced by: tk2dSprite, tk2dSpriteCollectionData, atlas0 materail, ManagedStaticReferences()
-
Hmmm.. thats really weird. If the sprite is there, it suggests there is a static ref to the sprite somewhere, and the sprite collection data, material, etc. are just offshoots from that. There aren't any static references in the tk2d runtime code base either, so this is really quite puzzling. The most puzzling is the tk2dSprite itself. I'm not sure what to suggest but to start knocking out code to track it down.
-
Yes, at that runtime, the Profiler's GameObject List, MonoBehavior List both haven't tk2dSprite.
Only the Texture List marked it reference to tk2d, and show memory used large.
-
https://www.dropbox.com/s/wsoi88f8ktcjgv5/1.png
https://www.dropbox.com/s/8e4d57zlhvmmg8u/2.png
-
You shouldn't have to worry about update manager - it only affects text meshes (to automatically commit at the end of the frame). Unless some race condition is preventing them from getting unloaded - try calling Resources.UnloadUnusedAssets after loading this new empty scene, that will rule it out. Also if you don't have text meshes from the same sprite collection as the problematic one, don't even bother trying that - this class only defer updates text meshes.
You seem to have a whole bunch of other stuff loaded - try an empty scene to see what you get there.
-
Remains the same after call UnloadUnusedAssets at empty scene's Start(), and in there StartCoroutine call GC.Collect() after 1 second.
Other people do not encounter such a situation?