1

how to remove defintion from the applicationDomain !

In my test I removed all references about one class but the definition is still exist in the applicationDomain, how to remove it, because I think it occupy my memory~

by the way, I use the Profile tool in flash builder 4.6, after gc the class instance num is 0, but the definition is still exist in the applicationDomain.

very thanks if anyone can help me !

Zeke
  • 11
  • 3

1 Answers1

0

Once you imported a definition into an application, unfortunately you cannot remove class definition. I just see two hacks :

Simon Eyraud
  • 2,445
  • 1
  • 20
  • 22
  • Hi Simsoft, thank you very much! I ask this question because we have a flash web game and it load pictures complete then use the getDefinitionByName(or getDefinition), so the definition is still in the appDomain when the picture is deleted, I wonder whether the definition is occupy too much memory or just a little? How to test this problem ? – Zeke Jun 17 '13 at 16:27
  • load them into a separate applicationDomain, keep a reference to the loader. When you want to delete a loaded swf, remove all occurence on displaylist, remove all references in your class, then call loader.unloadAndStop(true); – Simon Eyraud Jun 19 '13 at 08:01
  • I found wherever I load the definition It can not remove from the memory event though load to a a separate applicationDomain(the definition occupy) – Zeke Jun 21 '13 at 02:18