Make sure you understand the limitation of the loitering objects view.  It is 
explained in the profiler article on my blog.  You can get false positives from 
that view.

In theory BitmapData should not be leaked by the framework.  Any JPG, PNG, GIFs 
used in the app will be represented as BitmapData as well as any bitmap caches 
used for various effects, but the ones for effects should be transient in most 
cases.

Most flex apps are Class and Function bound.  The code in the framework and the 
code you write take up significant memory, but won't cause leaks unless you are 
hanging onto anonymous function references somehow.

You can use the allocation traces to see who created the bitmapdata instances.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of gtb104
Sent: Tuesday, October 20, 2009 4:07 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Huge impact of Class and Function on memory usage



Anyone?

--- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, 
"gtb104" <gtb...@...> wrote:
>
> I'm seeing similar results. We're taking great pains to reduce the memory 
> footprint of our application. We're getting the memory requirement down 
> slowly, but BitmapData is humongous!
>
> After running a test case 7 times, and finding the loitering objects, we see 
> the following (sorted by Memory usage):
>
> Class Package Instances Memory
> BitmapData flash.display 466(0.91%) 24820752(81.27%)
> Function 4275(8.37%) 1429405(4.68%)
> String 7768(15.21%) 582830(1.91%)
> Class 179(0.35%) 507919(1.66%)
> Object 7386(14.47%) 424292(1.39%)
> ....
>
> Over 81% of the memory is tied up in BitmapData. Doesn't this seem wrong? 
> I've scoured the internet looking for information on this topic, but am 
> coming up blank.
>
> My guess is that this BitmapData is internal snapshots of the UI that it 
> might be using for transitions/effects/skins/etc. We skin our application 
> using PNG assets. There are also two Image tags that get updated 
> alternatively with output from a mapping application on the back-end.
>
> I'd really appreciate an explanation of what generates the BitmapData, and 
> how to remove it from memory, as our application memory usage grown over time 
> and eventually crashes the browser.
>
> Thanks,
> Geoff
>
> --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, 
> "cesarerocchi" <cesarerocchi@> wrote:
> >
> > Nobody??
> >
> > --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, 
> > "cesarerocchi" <cesarerocchi@> wrote:
> > >
> > > Hi,
> > >
> > > in profiling my application, when I visualize the loitering objects, my 
> > > classes have an
> > impact
> > > of the 5% on memory usage. I think it is not much, but I see a huge 
> > > impact of Class,
> > Function,
> > > Bitmapdata, Object, String.
> > >
> > > Are these classes generating memory leaks?
> > >
> > > --
> > > Cesare Rocchi
> > > http:/spreadingfunkyness.com
> > >
> >
>

Reply via email to