RE: [flexcoders] Re: Modules the way to go?

2008-05-09 Thread Gregor Kiddie
From the docs...

Unloads the module. Flash Player and AIR will not fully unload and
garbage collect this module if there are any outstanding references to
definitions inside the module.

Which is what usually causes us the problems.

Do you have many references into or out from the module which might not
be released before you are trying to unload it? That could account for
some of the memory problems...

Only 6 small modules open though would suggest that one of them is
perhaps misbehaving in terms of memory usage which is then not getting
released when you try to unload the module.

Have you run the app through the profiler to check for any memory hogs?

 

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 [EMAIL PROTECTED]



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Daniel
Sent: 09 May 2008 01:15
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Modules the way to go?

 


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 mailto:flexcoders%40yahoogroups.com
, Gregor Kiddie [EMAIL PROTECTED] 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/ 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 [EMAIL PROTECTED]
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of Daniel
 Sent: 06 May 2008 22:15
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.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
mailto:flexcoders%40yahoogroups.com
 , Bjorn

Re: [flexcoders] Re: Modules the way to go?

2008-05-09 Thread Josh McDonald
Does the SDK open up developer access to the weak references?

-J

On Fri, May 9, 2008 at 5:33 PM, Gregor Kiddie [EMAIL PROTECTED] wrote:

From the docs…

 Unloads the module. Flash Player and AIR will not fully unload and
 garbage collect this module if there are any outstanding references to
 definitions inside the module.

 Which is what usually causes us the problems.

 Do you have many references into or out from the module which might not be
 released before you are trying to unload it? That could account for some of
 the memory problems…

 Only 6 small modules open though would suggest that one of them is perhaps
 misbehaving in terms of memory usage which is then not getting released when
 you try to unload the module.

 Have you run the app through the profiler to check for any memory hogs?



 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

 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
 [EMAIL PROTECTED]
   --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Daniel
 *Sent:* 09 May 2008 01:15

 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: Modules the way to go?




 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 flexcoders%40yahoogroups.com, Gregor
 Kiddie [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
 
  
 
  From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto:
 flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On
  Behalf Of Daniel
  Sent: 06 May 2008 22:15
  To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.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

Re: [flexcoders] Re: Modules the way to go?

2008-05-09 Thread Manish Jethani
On 5/9/08, Gregor Kiddie [EMAIL PROTECTED] wrote:

 From the docs…

 Unloads the module. Flash Player and AIR will not fully unload and garbage 
 collect this module if there are any outstanding references to definitions 
 inside the module.

 Which is what usually causes us the problems.
[snip]

About the memory thing: I had the problem of loaded SWFs not being
fully garbage collected. So I created a framework for cleaning up on
unload. It's very simple, and I've described it in this post on the
AIR list:

http://tech.groups.yahoo.com/group/apollocoders/message/2766

Basically, when you get the unload event for your module/application
SWF, you should:

1. Stop any running timers
2. Remove any 'enterFrame' event listeners
3. Close any open network connections
4. Remove any objects added to the stage
5. Remove any event listeners from the stage
6. Call dispose() on any BitmapData objects
7. Stop any sound that's playing and close the stream

... and so on.

You get the DisposalManager to call dispose() on each of your objects
on SWF unload, and the dispose() implementation is where you do the
above.

Also see Grant Skinner's article here:

http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html

Manish



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



RE: [flexcoders] Re: Modules the way to go?

2008-05-07 Thread Gregor Kiddie
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 [EMAIL PROTECTED]



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
[EMAIL PROTECTED] 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

RE: [flexcoders] Re: Modules the way to go?

2008-05-06 Thread Gregor Kiddie
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/ 

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 [EMAIL PROTECTED]



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Daniel
Sent: 06 May 2008 07:22
To: flexcoders@yahoogroups.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
, Alex Harui [EMAIL PROTECTED] 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@yahoogroups.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 
 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...