Bitmapdata heavy use - memory disaster (spark / fb4)

I have a flex component that works really well but sadly turns into a disaster that was once used in an item renderer of roughly 40-50 items.

Basically it uses bitmapdata to take a screenshot of a fully rendered web page in mx: HTML (this version of webkit rock btw, miles are better than flex 3).

The code is pretty self explanatory I think.

http://noben.org/show/PageGrabber.mxml

I optimized everything I could, browsing, looking for answers and already truncating this a lot, I desparate to reduce memory usage (about 600mb after 100 draw)

The garbage collector has little effect.

Thank! Nic

+2


source to share


3 answers


You need to call BitmapData.dispose()

when you're done with them, you can't just drop them and hope they get collected. Sometimes they will, but often not: '(



+2


source


will event listeners hang on because of the strong link? Try removing listeners or using weak links. See if this helps



+2


source


Have you ever given orders smallBMD

? You may want to make sure they don't accumulate in memory lingering after use, since you create a new one every time it is called passoire_completeHandler

without deleting the previous one (as far as I can see).

+1


source







All Articles