Hi all,
My forehead is becoming flatter by the minute as I bang my head
against the wall on this one....
In my dashboard application, I have a tab navigator with a canvas
that defines each tab. A single tab/canvas has numerous panels and each
panel has a swfloader swf file. When a user clicks on a different tab,
I'm trying to unload all the components on the tab (canvas.removeAll())
before making the switch...in an effort to free up the memory....I've
made sure to go thru and add appropriate listener removals but when I
run the app, I end up like an ant standing in front of Hoover dam,
yelling "Bring it on!!". After clicking the third tab, memory is maxed
and FF crashes....
So, I've run this sucker through the flex profiler....taken
snapshots and compared to find loitering objects...holy crap....there
are PAGES of loitering objects...with the top two offenders being 62,000
String instances taking up 3,233,462 (30.01%) of memory and 439 Class
instances taking up 3,308,623 (30.71%) of memory. Upon investigation,
every freakin string that is returned from my web service calls and used
in the panels is saved in memory...
The rest of the top ten list are: UITextField, Function, Object,
Array, Button, QName, WSDLMessagePart and UIComponent. (wtf is QName???)
I've poured thru what I can find on the net about getting rid of all
this junk...and haven't found much. I'm seriously hoping for some help
because we cannot go public beta with this until I get the memory
problems ironed out.
I found some information that is perplexing...
1.) The removeAll() doesn't actually unload anything from memory??
It only removes it from the container?? What!?!
2.) I scrapped the removeAll() and tried instead to use the
delete() function, cycling thru all the panels on the canvas and doing a
delete panel. That pukes on me with the error "1189: Attempt to delete
the fixed property mdiwindow. Only dynamically defined properties can
be deleted. "
3.) It seems that renderer's like to hang out for a while and enjoy
the show...with no clear way to get rid of them (kinda like my Uncle Jesse)
So, folks, all help here would certainly be appreciated....how in
the world do I get this stuff cleared out? Should I be trying to unload
the swf's or will that results in the same thing as the
removeAll()...gone...but not really?
Looking forward to getting this resolved,
Adrian