Hello Guest

Author Topic: About "ManagedStaticReferences()"  (Read 9342 times)

Companella

  • Newbie
  • *
  • Posts: 29
    • View Profile
About "ManagedStaticReferences()"
« 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.


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: About "ManagedStaticReferences()"
« Reply #1 on: March 27, 2014, 10:28:32 am »
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.

Companella

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: About "ManagedStaticReferences()"
« Reply #2 on: March 27, 2014, 10:53:56 am »
Same situation in .exe and .apk
and profiler marked Referenced by: tk2dSprite, tk2dSpriteCollectionData, atlas0 materail, ManagedStaticReferences()

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: About "ManagedStaticReferences()"
« Reply #3 on: March 27, 2014, 11:00:28 am »
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.

Companella

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: About "ManagedStaticReferences()"
« Reply #4 on: March 28, 2014, 11:03:18 am »
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.


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: About "ManagedStaticReferences()"
« Reply #6 on: March 28, 2014, 10:03:02 pm »
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.

Companella

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: About "ManagedStaticReferences()"
« Reply #7 on: March 29, 2014, 05:01:04 am »
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?