Search the web
Sign In
New User? Sign Up
flexcoders · RIA Development with Adobe Flex
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Adobe, Help Memory Leaking !!   Message List  
Reply | Forward Message #48340 of 150613 |
RE: [flexcoders] Adobe, Help Memory Leaking !!

Yes!

 

OPTION A has 4 instances of 4 classes

 

OPTION B has 2 instances of 2 classes

 

Depending on the classes in use, the instances and classes will use more RAM.

 

I do not know which one is smaller but I would guess OPTION B.

 

Ted

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Rich Tretola
Sent: Thursday, August 24, 2006 9:54 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Adobe, Help Memory Leaking !!

 

Thanks Ted,

I have another question that is somewhat related.  Is there a difference in ram usage between the following:

OPTION A:
    <mx:HBox width="500">
        <mx:Spacer width="100%"/>
        <mx:Label text="Hello World" />
        <mx:Spacer width="100%"/>
    </mx:HBox>
   
OPTION B:
    <mx:Canvas width="500">
        <mx:Label text="Hello World"  horizontalCenter="0"/>
    </mx:Canvas>

Rich

On 8/24/06, Ted Patrick <tpatrick@adobe.com> wrote:

Rich,

 

I believe the process of allocating RAM to the Player is dependent on the OS/Browser. If the OS/Browser feels like giving the player more RAM then the player will behave differently in its performance profile. The player is always designed with the low end machines in mind.

 

Note: The player is greedy, once you give it system resources; it uses those in an optimized manner. It will give back resources but only when the use pattern has materially changed.

 

Again, using flash.system.System.totalMemory represents all the memory allocated to the player, not necessarily the memory being used by objects. An incremental GC run will reduce the objects within the totalMemory but the value WILL NOT CHANGE EVER!!! Please do not use totalMemory as a gauge for leaking memory or GC action/inaction. Depending on the OS, the player will be allocated more or less resources and will tune within what is provided.

 

Rich, I believe your machine is giving the player lots of RAM and the player is just not giving it back. There may be a use case within the way you are using Repeater such that inner references are not being cleaned up.

 

You can also use ItemRenderer to accomplish the same thing. See if you are seeing the same behavior there.

 

The crashing concerns me and I have logged a bug.

 

Ted Patrick

Flex Evangelist

Adobe Systems Incorporated

 

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Rich Tretola
Sent: Thursday, August 24, 2006 8:10 AM
To: flexcoders@yahoogroups.com


Subject: Re: [flexcoders] Adobe, Help Memory Leaking !!

 

A little update with some additional testing.

I am running the exact same application on 2 machines, one has 2 gigs of system ram and the other has 128 megs of ram.  On the machine with the low ram, the app runs with a much smaller ram footprint.

Does the flash player allocate more memory than needed when it is available on some machines as comparted to machines that have limited ram?


Rich

On 8/24/06, Rich Tretola <rtretola@gmail.com> wrote:

False is the default setting for recycleChildren, but I have also added it and tried it both ways.


Rich

 

On 8/23/06, Joshua Garnett < josh.garnett@gmail.com> wrote:

Have you tried setting the recycleChildren attribute of the Repeater to false?  I believe when you have recycleChildren set to true, even if you reduce the number of items in the dataProvider, it still keeps an object in memory that it will reuse.  I've actually encountered other issues with having recycleChildren set to true when the repeaters are nested within repeaters.  There doesn't seem to be any noticeable performance hit by switching it to false.


--Josh

 

On 8/23/06, Rich Tretola < rtretola@gmail.com> wrote:

How you found any kind of resolution?  As it stand right now my application will be unusable by most of my audience which will obviously not make management happy.  I haven't had this problem with other apps, but there were not nearly as object and data intense.


Rich



On 8/23/06, sinatosk < sinatosk@gmail.com> wrote:

just want to say your not the only one... 2 other people have had the same sort of problem here and I have too... it's annoying to be honest. it does go down eventually but not by it self... I've left it running overnight ( one of my applications ) doesn't go down much

 

On 24/08/06, Rich Tretola < rtretola@gmail.com> wrote:

Just try loading a large amount of buttons a few times and watch the memory go up and up.  When I went back to just a few buttons, the memory actually went up a little rather than dropping back down.

Rich

On 8/23/06, Rich Tretola < rtretola@gmail.com> wrote:

The 300 megs is the application that I am working on, not the sample app.  The actual project app has about 20 or so repeaters, the sample was just a single version to demonstrate that the garbage collector is not working.

I have been able to get the sample app over 200 megs of ram usage by runnig 5000 buttons a few times, the app memory in the txt box shows about 185 megs  See the attached screen shots.  The 5000 was created 1st and then I updated the array to 5 buttons and waited and then took the 2nd screen shot.  The browser never releases the memory and neither does the flash player.





Rich

On 8/23/06, Ted Patrick < tpatrick@adobe.com> wrote:

Rich,

 

No. I have yet to run this app and see 300MB of RAM consumed ever.  Mine gets a ceiling of like 12MB and never goes higher.

 

When the GC runs it destroys objects within the totalMemory within the player. When the player needs more memory for new objects, it adds memory if the gc cannot dispose of what is needed. It is true to say that on machines with ample resources, the player may accumulate more resources but this is true with all applications.

 

I have to say I think you may be looking at a bug specific to your os/system configuration. Is the behavior browser specific?

 

Just to be sure: 300 megabytes = 314,572,800 bytes

 

Ted Patrick

Flex Evangelist

Adobe Systems Incorporated

 

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Rich Tretola
Sent: Wednesday, August 23, 2006 2:09 PM


To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Adobe, Help Memory Leaking !!

 

I first noticed this issue while looking at the task manager and seeing firefox and IE memory usage going up and up to well over 300 megs of ram.  If I am running the app on a machine with less ram will the browser use less memory?  Is that what you are saying? 

Rich

On 8/23/06, Ted Patrick < tpatrick@adobe.com> wrote:

Rich,

 

Ok got some information for you:

 

flash.system.System.totalMemory - The amount of memory (in bytes) currently in use by Adobe® Flash® Player.

 

A better way to think about this is allocated memory. When the player needs more memory it acquires it from the OS/Browser in use. The player doesn't necessarily give the memory back. Within that memory in use are the objects being used. When GC runs, it disposes objects within the allocated memory but doesn't give memory back to the OS/Browser.

 

The GC is running and collecting objects, but f lash.system.System.totalMemory is not the right way to see this happening.

 

Ted Patrick

Flex Evangelist

Adobe Systems Incorporated

 

  


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Rich Tretola
Sent: Wednesday, August 23, 2006 12:11 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Adobe, Help Memory Leaking !!

 

I am testing locally on a pentium m 1.6 2 gigs ram FP 9.16
I have tried firefox, and ie on winxp

On my sample, if you change the number to like 500 and create 500 buttons and then change it back to 3 buttons, why can I not recover the memory from the 497 buttons that are no longer being used?

This is a huge probolem on my app because it has like 30 Repeaters that are constantly changing dataProviders on user decisions and the memory is out of control, eventually crashing the browser (remember I have 2 gigs of ram).

Rich

On 8/23/06, Ted Patrick < tpatrick@adobe.com> wrote:

Rich,

 

The app takes memory up 7MB then drops back to 5Mb on a GC run. There is no way to force the GC to run.

 

Can you also send me your browser, os, player version. Also are you on a dual-core machine?

 

Ted

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Rich Tretola
Sent: Wednesday, August 23, 2006 5:29 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Adobe, Help Memory Leaking !!

 

I have an application that uses many repeaters where the repeater's
dataproviders are constantly updated which redraws the view. All look
fine visually, however the flash player continues to use more and more
memory.

I created a demo version of this at
http://www.everythingflex.com/flex2/MemoryTest/

I have buttons which up the amount of repeater items and then lower
them and also attemp to delete the arraycollection, delete the
dataprovider, etc but the memory never is recaptured.

The source is also provided.

Does anyone know how to get the garbage collection to run when the
repeaters content changes??

Rich




--
Rich Tretola
<mx:EverythingFlex/>
http://www.EverythingFlex.com




--
Rich Tretola
<mx:EverythingFlex/>
http://www.EverythingFlex.com




--
Rich Tretola
<mx:EverythingFlex/>
http://www.EverythingFlex.com





--
Rich Tretola
<mx:EverythingFlex/>
http://www.EverythingFlex.com







--
Rich Tretola
<mx:EverythingFlex/>
http://www.EverythingFlex.com

 




--
Rich Tretola
<mx:EverythingFlex/>
http://www.EverythingFlex.com




--
Rich Tretola
<mx:EverythingFlex/>
http://www.EverythingFlex.com




--
Rich Tretola
<mx:EverythingFlex/>
http://www.EverythingFlex.com



Thu Aug 24, 2006 5:08 pm

adobeted
Offline Offline
Send Email Send Email

Forward
Message #48340 of 150613 |
Expand Messages Author Sort by Date

I have an application that uses many repeaters where the repeater's dataproviders are constantly updated which redraws the view. All look fine visually,...
Rich Tretola
rtretola@...
Send Email
Aug 23, 2006
12:57 pm

Anyone have any ideas on this issue? Rich ... -- Rich Tretola <mx:EverythingFlex/> http://www.EverythingFlex.com...
Rich Tretola
rtretola@...
Send Email
Aug 23, 2006
4:55 pm

Rich, The app takes memory up 7MB then drops back to 5Mb on a GC run. There is no way to force the GC to run. Can you also send me your browser, os, player...
Ted Patrick
adobeted
Offline Send Email
Aug 23, 2006
5:04 pm

I am testing locally on a pentium m 1.6 2 gigs ram FP 9.16 I have tried firefox, and ie on winxp On my sample, if you change the number to like 500 and create...
Rich Tretola
rtretola@...
Send Email
Aug 23, 2006
7:15 pm

Rich, Ok got some information for you: flash.system.System.totalMemory - The amount of memory (in bytes) currently in use by Adobe(r) Flash(r) Player. A better...
Ted Patrick
adobeted
Offline Send Email
Aug 23, 2006
8:54 pm

I first noticed this issue while looking at the task manager and seeing firefox and IE memory usage going up and up to well over 300 megs of ram. If I am...
Rich Tretola
rtretola@...
Send Email
Aug 23, 2006
9:28 pm

Rich, No. I have yet to run this app and see 300MB of RAM consumed ever. Mine gets a ceiling of like 12MB and never goes higher. When the GC runs it destroys...
Ted Patrick
adobeted
Offline Send Email
Aug 23, 2006
10:37 pm

The 300 megs is the application that I am working on, not the sample app. The actual project app has about 20 or so repeaters, the sample was just a single...
Rich Tretola
rtretola@...
Send Email
Aug 23, 2006
11:39 pm

... Firefox certainly attempts to set some internal pool sizes based on the O/S RAM size. -- Tom Chiverton Helping to heterogeneously restore cutting-edge...
Tom Chiverton
tom.chiverton
Offline Send Email
Aug 24, 2006
8:24 am

Just try loading a large amount of buttons a few times and watch the memory go up and up. When I went back to just a few buttons, the memory actually went up...
Rich Tretola
rtretola@...
Send Email
Aug 23, 2006
11:27 pm

just want to say your not the only one... 2 other people have had the same sort of problem here and I have too... it's annoying to be honest. it does go down...
sinatosk
Offline Send Email
Aug 24, 2006
12:21 am

How you found any kind of resolution? As it stand right now my application will be unusable by most of my audience which will obviously not make management...
Rich Tretola
rtretola@...
Send Email
Aug 24, 2006
12:50 am

Have you tried setting the recycleChildren attribute of the Repeater to false? I believe when you have recycleChildren set to true, even if you reduce the...
Joshua Garnett
joshgamedev
Offline Send Email
Aug 24, 2006
3:29 am

False is the default setting for recycleChildren, but I have also added it and tried it both ways. Rich ... -- Rich Tretola <mx:EverythingFlex/> ...
Rich Tretola
rtretola@...
Send Email
Aug 24, 2006
9:47 am

A little update with some additional testing. I am running the exact same application on 2 machines, one has 2 gigs of system ram and the other has 128 megs of...
Rich Tretola
rtretola@...
Send Email
Aug 24, 2006
3:20 pm

Rich, I believe the process of allocating RAM to the Player is dependent on the OS/Browser. If the OS/Browser feels like giving the player more RAM then the...
Ted Patrick
adobeted
Offline Send Email
Aug 24, 2006
4:27 pm

Thanks Ted, I have another question that is somewhat related. Is there a difference in ram usage between the following: OPTION A: <mx:HBox width="500"> ...
Rich Tretola
rtretola@...
Send Email
Aug 24, 2006
5:01 pm

Yes! OPTION A has 4 instances of 4 classes OPTION B has 2 instances of 2 classes Depending on the classes in use, the instances and classes will use more RAM. ...
Ted Patrick
adobeted
Offline Send Email
Aug 24, 2006
5:17 pm

Correction: OPTION A has 4 instances of 3 classes I counted Spacer 2 times in Option A. I make mistakes too! Ted :-) ________________________________ From:...
Ted Patrick
adobeted
Offline Send Email
Aug 24, 2006
5:27 pm

wait little mix up... it does go down by itself but only if the application seems to increase the memory usage fast or something like that but even then that...
sinatosk
Offline Send Email
Aug 24, 2006
12:53 am

Yes I have had the same problem with all the applications that I have created. Not sure if bad coding on my part or bug in the plugin. Hope this problem gets...
Henry
hcastiel
Offline Send Email
Aug 24, 2006
3:26 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help