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:
Sent: Thursday, August 24, 2006
9:54 AM
To:
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,
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.
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.
Flex
Evangelist
Adobe
Systems Incorporated
From: flexcoders@yahoogro
Sent: Thursday, August 24, 2006
8:10 AM
To: flexcoders@yahoogro
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.
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@
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.
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.
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.
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.
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@yahoogro
ups.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?
RichOn 8/23/06,
Ted Patrick < tpatrick@adobe.com > wrote:Rich,
Ok got some information for you:
flash.system.
System.totalMemo ry - 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.totalMemo ry is not the right way to see this happening.
Ted Patrick Flex Evangelist
Adobe Systems Incorporated
From: flexcoders@yahoogro
ups.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).
RichOn 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@yahoogro
ups.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.Everythi
--
Rich Tretola
<mx:EverythingFlex/>
http://www.Everythi
--
Rich Tretola
<mx:EverythingFlex/>
http://www.Everythi
--
Rich Tretola
<mx:EverythingFlex/>
http://www.Everythi
--
Rich Tretola
<mx:EverythingFlex/>
http://www.Everythi