Skip navigation
Currently Being Moderated

Memory leaks nightmares

Feb 21, 2013 12:15 PM

Here is a sample code that according to Profiler creates a memory leak:


public class class1 ButtonRendererBase extends something else



     public function class1()



               setStyle('skinClass', skinClass); // without this no memeory leak.




Why is in the world attaching a skin creates a memory leak?



  • Currently Being Moderated
    Feb 22, 2013 10:58 AM   in reply to Zolotoj

    What does the profiler show?


    If the skin adds an event listener to a gc root like timer or frame events, then that skin will pin its host component.

    Mark as:
  • Currently Being Moderated
    Feb 22, 2013 11:48 AM   in reply to Zolotoj

    Hard to say.  I saw a BitmapImage in there.  If that hosts a  SWF that animates that will cause a leak.  If Chevron is an animation that can also be a problem.  Try removing those elements as a test.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points