Re: [flexcoders] Objects are not Garbage Collected
10X a lot now things are working fine . --- On Thu, 11/6/08, Fotis Chatzinikos <[EMAIL PROTECTED]> wrote: > From: Fotis Chatzinikos <[EMAIL PROTECTED]> > Subject: Re: [flexcoders] Objects are not Garbage Collected > To: flexcoders@yahoogroups.com > Date: Thursday, November 6, 2008, 12:03 AM > very quickly, *objArrCollModelsVO* seems like an > arraycollection... > > are you sure that your for loop removes all references? > > if item 0 is removed, item 1 becomes 0, so next time when > you remove 1 you > are in reality removing 2 and so on... > > try: > * > for( var** k:int = **model.objArrCollModelsVO.length **; k > >= 0 ;k-- ) * > > *{* > > > On Wed, Nov 5, 2008 at 3:04 PM, Parkash > <[EMAIL PROTECTED]> wrote: > > >Hi all i have written a simple flex applcation and > i am using a > > Caringorm framework. > > In my command class i am parsing a xml response and > cretating about 100 > > value object and iam adding these object in a > ArrayCollection which is bind > > to some gird . when i enters in execute method i > explicitly remove each > > object from collection like this > > > > > > *for( var** k:int = 0 ; k < > model.objArrCollModelsVO.length ;k++ ) * > > > > *{* > > > > *var** obj:Object = > model.objArrCollModelsVO.removeItemAt( k );* > > > > *trace( "GOing to Remove "** + obj.name > );* > > > > *obj = **null** ;* > > > > *}* > > > > > > > > but these are objects are not garbage collected and > remians in memory can > > any one tell how to resolve this problem b/c my > application is getting very > > slow if my commnd class runs more than 6 times Or > any one can send some > > good tutorial about Garbage collection in Flex > > > > > > > > Thanks in Advance > > > > Parkash ARjan... > > > > > > > > > > > > > > > -- > Fotis Chatzinikos, Ph.D. > Founder, > Phinnovation > [EMAIL PROTECTED],
Re: [flexcoders] Objects are not Garbage Collected
Well spotted! - Original Message - From: Fotis Chatzinikos To: flexcoders@yahoogroups.com Sent: Wednesday, November 05, 2008 7:03 PM Subject: Re: [flexcoders] Objects are not Garbage Collected very quickly, objArrCollModelsVO seems like an arraycollection... are you sure that your for loop removes all references? if item 0 is removed, item 1 becomes 0, so next time when you remove 1 you are in reality removing 2 and so on... try: for( var k:int = model.objArrCollModelsVO.length ; k >= 0 ;k-- ) { On Wed, Nov 5, 2008 at 3:04 PM, Parkash <[EMAIL PROTECTED]> wrote: Hi all i have written a simple flex applcation and i am using a Caringorm framework. In my command class i am parsing a xml response and cretating about 100 value object and iam adding these object in a ArrayCollection which is bind to some gird . when i enters in execute method i explicitly remove each object from collection like this for( var k:int = 0 ; k < model.objArrCollModelsVO.length ;k++ ) { var obj:Object = model.objArrCollModelsVO.removeItemAt( k ); trace( "GOing to Remove " + obj.name ); obj = null ; } but these are objects are not garbage collected and remians in memory can any one tell how to resolve this problem b/c my application is getting very slow if my commnd class runs more than 6 times Or any one can send some good tutorial about Garbage collection in Flex Thanks in Advance Parkash ARjan... -- Fotis Chatzinikos, Ph.D. Founder, Phinnovation [EMAIL PROTECTED],
Re: [flexcoders] Objects are not Garbage Collected
very quickly, *objArrCollModelsVO* seems like an arraycollection... are you sure that your for loop removes all references? if item 0 is removed, item 1 becomes 0, so next time when you remove 1 you are in reality removing 2 and so on... try: * for( var** k:int = **model.objArrCollModelsVO.length **; k >= 0 ;k-- ) * *{* On Wed, Nov 5, 2008 at 3:04 PM, Parkash <[EMAIL PROTECTED]> wrote: >Hi all i have written a simple flex applcation and i am using a > Caringorm framework. > In my command class i am parsing a xml response and cretating about 100 > value object and iam adding these object in a ArrayCollection which is bind > to some gird . when i enters in execute method i explicitly remove each > object from collection like this > > > *for( var** k:int = 0 ; k < model.objArrCollModelsVO.length ;k++ ) * > > *{* > > *var** obj:Object = model.objArrCollModelsVO.removeItemAt( k );* > > *trace( "GOing to Remove "** + obj.name );* > > *obj = **null** ;* > > *}* > > > > but these are objects are not garbage collected and remians in memory can > any one tell how to resolve this problem b/c my application is getting very > slow if my commnd class runs more than 6 times Or any one can send some > good tutorial about Garbage collection in Flex > > > > Thanks in Advance > > Parkash ARjan... > > > > > -- Fotis Chatzinikos, Ph.D. Founder, Phinnovation [EMAIL PROTECTED],
Re: [flexcoders] Objects are not Garbage Collected
Thank you Pual for your reply but my Value Objects don't have any listeners attached to them and no other variable reference's to them i have double checked every thing after your reply and i still don't have any clue what is going on ,my task mangers shows me increase of 2MB whenever my command class runs , moreover my view object is singleton and forcefully call refresh method when i add my view to display this refresh method actually dispatches Caringorm event. - Original Message - From: "Paul Andrews" <[EMAIL PROTECTED]> To: Sent: Wed, 5 Nov 2008 13:17:47 - Subject: Re: [flexcoders] Objects are not Garbage Collected > In order to be garbage collected there must not be any references to the > object at all. If you have assigned another variable to the object and not > set that to null, it won't be collected. If you have an event handler > associated with an object, it won't be collected. When nothing at all is > referencing the object it becomes eligible for collection. Sometimes that's > easier said than done. > > BTW if you have references to children of the object, they won't be available > for garbage collection until no references to them exist. > > Paul > - Original Message - > From: Parkash > To: flexcoders@yahoogroups.com > Sent: Wednesday, November 05, 2008 1:04 PM > Subject: [flexcoders] Objects are not Garbage Collected > > > Hi all i have written a simple flex applcation and i am using a Caringorm > framework. > In my command class i am parsing a xml response and cretating about 100 > value object and iam adding these object in a ArrayCollection which is bind > to some gird . when i enters in execute method i explicitly remove each > object from collection like this > > for( var k:int = 0 ; k < model.objArrCollModelsVO.length ;k++ ) > > { > > var obj:Object = model.objArrCollModelsVO.removeItemAt( k ); > > trace( "GOing to Remove " + obj.name ); > > obj = null ; > > } > > > > but these are objects are not garbage collected and remians in memory can > any one tell how to resolve this problem b/c my application is getting very > slow if my commnd class runs more than 6 times Or any one can send some > good tutorial about Garbage collection in Flex > > > > Thanks in Advance > > Parkash ARjan... > > > > > >
Re: [flexcoders] Objects are not Garbage Collected
In order to be garbage collected there must not be any references to the object at all. If you have assigned another variable to the object and not set that to null, it won't be collected. If you have an event handler associated with an object, it won't be collected. When nothing at all is referencing the object it becomes eligible for collection. Sometimes that's easier said than done. BTW if you have references to children of the object, they won't be available for garbage collection until no references to them exist. Paul - Original Message - From: Parkash To: flexcoders@yahoogroups.com Sent: Wednesday, November 05, 2008 1:04 PM Subject: [flexcoders] Objects are not Garbage Collected Hi all i have written a simple flex applcation and i am using a Caringorm framework. In my command class i am parsing a xml response and cretating about 100 value object and iam adding these object in a ArrayCollection which is bind to some gird . when i enters in execute method i explicitly remove each object from collection like this for( var k:int = 0 ; k < model.objArrCollModelsVO.length ;k++ ) { var obj:Object = model.objArrCollModelsVO.removeItemAt( k ); trace( "GOing to Remove " + obj.name ); obj = null ; } but these are objects are not garbage collected and remians in memory can any one tell how to resolve this problem b/c my application is getting very slow if my commnd class runs more than 6 times Or any one can send some good tutorial about Garbage collection in Flex Thanks in Advance Parkash ARjan...
[flexcoders] Objects are not Garbage Collected
Hi all i have written a simple flex applcation and i am using a Caringorm framework. In my command class i am parsing a xml response and cretating about 100 value object and iam adding these object in a ArrayCollection which is bind to some gird . when i enters in execute method i explicitly remove each object from collection like this for( var k:int = 0 ; k < model.objArrCollModelsVO.length ;k++ ) { var obj:Object = model.objArrCollModelsVO.removeItemAt( k ); trace( "GOing to Remove " + obj.name ); obj = null ; } but these are objects are not garbage collected and remians in memory can any one tell how to resolve this problem b/c my application is getting very slow if my commnd class runs more than 6 times Or any one can send some good tutorial about Garbage collection in Flex Thanks in Advance Parkash ARjan...