The true test of a leak is whether your OS’s process manager says that memory 
consumption keeps going up.

Before we had a profiler, we would add code to the app to exercise some 
sequence (by faking button events, etc), force garbage collection, and report 
System.totalMemory over and over again and run it overnight.  Due to the way 
Flash manages memory, just manually exercising the sequence a few dozen times 
may show increasing memory even though there isn’t a leak, although really bad 
leaks will show up in System.totalMemory or in the OS process manager pretty 
quickly.  Leaky apps will eventualy crash the browser, or just report an 
endless increase in memory, way past what you would expect for an app of that 
size and complexity.

Historically, the profiler has shown a dependency on the version of the Flash 
Player.  Whatever version of Flash Player is recommended for the default SDK in 
your version of Flash Builder should be the one to use when profiling.  Newer 
and older versions may report memory slightly differently and fool the profiler.

HTH,
-Alex

On 2/5/13 5:57 AM, "Nigel Magnay" <nigel.mag...@gmail.com> wrote:






We have an application that is leaking memory. Sadly, trying to diagnose this 
with the flex profiler (4.6, 4.7) is proving to be a frustrating experience.

I've picked on one object class to try and understand what is going on. We have 
a wizard-style dialog box with a sidebar control 'wizardlinks' which adds 
'wizardlink' objects to it. Both are Spark group controls. The links are being 
added to the group with an 'addElement' call.

The WizardLink instances are growing in memory and do not seem to be being 
released. I've pared them right down to try and eliminate possible listeners.

If I immediately remove the link, Something still seems to hold on to it. If I 
view it in the profiler object view, it expands saying (1 Path) but won't 
describe what it is. Even more mysteriously - if I run with "Watch live memory 
data", I can see the instances going up -- but if I then do a memory dump, 
those instances are now missing. If I don't run with 'watch live memory data', 
they are there.

Part of this feels like chasing shadows - are these real leaks, or just things 
the collector will eventually get round to?







--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui

Reply via email to