Funny you bring this up, it came up in a separate discussion today.  We
don't have a "typical" memory usage for a Flex app, it really depends on
what kind of work your application does. Do you load lots of images?
Those can take up space.  How many components do you have, do you load
them in a deferred manner or all at once?  One thing to remember is that
the Flash Player allocates memory in chunks, and it may not release
memory until enough has been allocated to force it to GC.  So let's say
it allocated 40 megs.  If the app happened to get to 33 megs there may
be no need for the Player to GC.  And it could be that in reality the
Player could get away with only 20 megs, but it will take that whole 40
b/c the OS is letting it and it.  Still not technically a memory leak,
even if you think the task manager should show less.
 
Remember to remove children from the display list.  Remember to remove
event listeners or use weak listeners where appropriate.  
 
Hope this helps,
Matt

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of jeofmoyster
Sent: Monday, March 05, 2007 12:34 PM
To: [email protected]
Subject: [flexcoders] Flex Player 9's (Flex 2) Memory Usage - What's
Normal?



So I'm developing what will be a good-sized application, but I'll be
carefully planning for download speed and runtime efficiency through
ModuleLoader, SWFLoader, etc. 

Right now I've barely begun but have finished the ground level for the
Data Retrieval, Normalization and Management (no FDS). The memory
monitor object shows about 40 megabytes of memory being used when the
data comes in, and drops to 24 MB if I leave the app still for a a
couple minutes afterward (I assume that's garbage collection kicking
after the data normalization). 

Flex is one my first forays into needing to worry about things like
memory management, so I'm looking for best practice and a baseline of
what's expected and acceptable. 

1) What's "average" memory load for a Flex application? When do I
start freaking out about using too much memory? 

2) How do I optimize memory management during run time? What's the
best way to encourage good garbage collection? 

Ideally this app will cache the data it receives over the course of
its runtime so switching back to older sets is faster than reloading
it from the server, but if this seriously chokes memory, I need to
come up with a new strategy.

Any help is appreciated!



 

Reply via email to