unloading the module does not guarantee it will cleaned up by Garbage
Collection.

You can use the Profiler to assist you see what has be collected by GC
and what hasn't.

Grant Skinner wrote a 3 part article on this explaining the details.
http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html




--- In flexcoders@yahoogroups.com, "Daniel" <[EMAIL PROTECTED]> wrote:
>
> 
> The crashing of the explorer is due to the amount of load in memory.
> It's not a Flex Error in the white box at the top left form. 
> 
> We load the modules this way:
> 
> public function createModule ( url : String ) : void
> {
>                       var panel : Panel = new Panel();
>                       var module : IModuleInfo = ModuleManager.getModule( url 
> );
>                       module.addEventListener( ModuleEvent.READY,
>                               function moduleReadyHandler ( event : 
> ModuleEvent ) : void
>                               {
>                                       var view : UIComponent = 
> module.factory.create() as UIComponent;
>                                       view.x = 0;
>                                       view.y = 0;
>                                       view.percentHeight = 100;
>                                       view.percentWidth = 100;
>                                       panel.addChild( view );
>                                       module.removeEventListener( 
> ModuleEvent.READY,
moduleReadyHandler );
>                               }
>                       );
>                       module.load ( );
> }
> 
> 
> and the unload is done this way:
> 
> public function closeModule ( url : String ) : void
> {
>                       var module : IModuleInfo = ModuleManager.getModule( url 
>  );
>                       module.unload();
> }
> 
> It's simple... basic... Am I missing something?
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "Gregor Kiddie" <gkiddie@> wrote:
> >
> > How are you unloading the modules? We've found that its relatively
tough
> > to get a module garbage collected given the amount of references
usually
> > flying round the place!
> > 
> > Also, have you debugged the app to find out exactly what is happening
> > when the crashing behaviour occurs? It might be more straightforward
> > then you think.
> > 
> >  
> > 
> > Gk.
> > 
> > Gregor Kiddie
> > Senior Developer
> > INPS
> > 
> > Tel:       01382 564343
> > 
> > Registered address: The Bread Factory, 1a Broughton Street, London SW8
> > 3QJ
> > 
> > Registered Number: 1788577
> > 
> > Registered in the UK
> > 
> > Visit our Internet Web site at www.inps.co.uk
> > <blocked::http://www.inps.co.uk/> 
> > 
> > The information in this internet email is confidential and is intended
> > solely for the addressee. Access, copying or re-use of information
in it
> > by anyone else is not authorised. Any views or opinions presented are
> > solely those of the author and do not necessarily represent those of
> > INPS or any of its affiliates. If you are not the intended recipient
> > please contact is.helpdesk@
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
> > Behalf Of Daniel
> > Sent: 06 May 2008 22:15
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Re: Modules the way to go?
> > 
> >  
> > 
> > 
> > 40 modules running at the same time with no issues?
> > God... That's an accomplishment... Does RAM and processor have
> > something to do with it? Our test computers are running on 1GB RAM,
> > and most have Flex Builder opened at a time...
> > 
> > The desktop manager load the modules per user request... The same for
> > unloading them... The module loaders are childs of a panel that can be
> > draggable and resizable, with a maximize and a close button... So if
> > the user choose to open N modules at the same, N modules will be
> > displayed...
> > 
> > A problem might be that by rule, the modules have tons of bindings...
> > Each component have at least one binding to it's correspondent value
> > in the modelLocator, and each component that have a dataProvider have
> > at one more binding... This bindings are not being set to "unwatch"
> > after the modules are unloaded... Could this be the issue that is
> > overloading the application and crashing the browser? 
> > 
> > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
> > , "Bjorn Schultheiss"
> > <bjorn.mailinglists@> wrote:
> > >
> > > Any external swf you load can crash your app.
> > > It's a really big issue with the player at the moment.
> > > 
> > > From my experience Modules provide you a good basis for multi-swf
> > > architecture with Flex.
> > > 
> > > 
> > > 
> > > --- In flexcoders@yahoogroups.com
> > <mailto:flexcoders%40yahoogroups.com> , "Gregor Kiddie" <gkiddie@>
> > wrote:
> > > >
> > > > "I won't develop the modules"
> > > > 
> > > > Well, that's your biggest problem, without being able to
control the
> > > > modules, you can't guarantee the behaviour. It's quite possible if
> > one
> > > > misbehaves it could lock your app up.
> > > > 
> > > > 
> > > > 
> > > > "If I have several small modules opened (say 6 to 10, each of
20K to
> > > > 60K size), they shouldnt crash or overload the browser?"
> > > > 
> > > > No they shouldn't. We run an application with similar amounts of
> > modules
> > > > (though bigger in size) without too many problems. There is
> > anecdotal
> > > > evidence of people on this board running with many more (40?
IIRC).
> > > > 
> > > > How are you organising the desktop? Do you have all the modules
> > > > displayed at the same time (you did mention open but that's not
> > the same
> > > > thing)?
> > > > 
> > > > Gk.
> > > > 
> > > > Gregor Kiddie
> > > > Senior Developer
> > > > INPS
> > > > 
> > > > Tel: 01382 564343
> > > > 
> > > > Registered address: The Bread Factory, 1a Broughton Street, London
> > SW8
> > > > 3QJ
> > > > 
> > > > Registered Number: 1788577
> > > > 
> > > > Registered in the UK
> > > > 
> > > > Visit our Internet Web site at www.inps.co.uk
> > > > <blocked::http://www.inps.co.uk/ <http://www.inps.co.uk/> > 
> > > > 
> > > > The information in this internet email is confidential and is
> > intended
> > > > solely for the addressee. Access, copying or re-use of information
> > in it
> > > > by anyone else is not authorised. Any views or opinions presented
> > are
> > > > solely those of the author and do not necessarily represent
those of
> > > > INPS or any of its affiliates. If you are not the intended
recipient
> > > > please contact is.helpdesk@
> > > > 
> > > > ________________________________
> > > > 
> > > > From: flexcoders@yahoogroups.com
> > <mailto:flexcoders%40yahoogroups.com> 
> > [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
> > ] On
> > > > Behalf Of Daniel
> > > > Sent: 06 May 2008 07:22
> > > > To: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
> > 
> > > > Subject: [flexcoders] Re: Modules the way to go?
> > > > 
> > > > 
> > > > 
> > > > 
> > > > That's the problem... I won't develop the modules that will be
> > running
> > > > in the desktop manager... I'll only load them and unload
them... But
> > I
> > > > want to make sure the application runs fast...
> > > > 
> > > > Are there any tricks or tips to ensure the modules run fast and
> > > > release unused resources? 
> > > > 
> > > > If I have several small modules opened (say 6 to 10, each of
20K to
> > > > 60K size), they shouldnt crash or overload the browser?
> > > > 
> > > > --- In flexcoders@yahoogroups.com
> > <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com>
> > > > , "Alex Harui" <aharui@> wrote:
> > > > >
> > > > > A module is as big as you make it. I'd be checking to make sure
> > it is
> > > > > small and releases unused resources.
> > > > > 
> > > > > 
> > > > > 
> > > > > ________________________________
> > > > > 
> > > > > From: flexcoders@yahoogroups.com
> > <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com>
> > > > [mailto:flexcoders@yahoogroups.com
> > <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com>
> > > > ] On
> > > > > Behalf Of Daniel
> > > > > Sent: Monday, May 05, 2008 8:19 PM
> > > > > To: flexcoders@yahoogroups.com
> > <mailto:flexcoders%40yahoogroups.com> 
> > <mailto:flexcoders%40yahoogroups.com> 
> > > > > Subject: [flexcoders] Modules the way to go?
> > > > > 
> > > > > 
> > > > > 
> > > > > Hey guys,
> > > > > 
> > > > > Im actually working on an application that controls several Flex
> > made
> > > > > apps. It's like a desktop manager application that manages
several
> > > > > widgets. The applications running in the desktop manager are
> > modules
> > > > > set on the server, that are loaded and unloaded per user
> > request, but
> > > > > when a user have 6 or more Modules opened at the time the
desktop
> > > > > manager becomes really slow, and the explorer can even crash!
> > > > > 
> > > > > Am I working the modules the wrong way, or this component really
> > adds
> > > > > that kind of weight to the computer? Is there another way to go?
> > > > > 
> > > > > Thanx a lot guys...
> > > > >
> > > >
> > >
> >
>


Reply via email to