Alex -
That is my posting, and I would hate for it to be "misinformation" in
any way. If your research turns up no evidence that I am correct then I
will endeavor to re-create my problem in a sample application that I can
send along to you for inspection. If I cannot successfully demonstrate
that binding to e4x is leaking memory I will be more than happy to
withdraw my posting. However, I should note, that I had a friend who
was working on a similar application (datagrid bound directly to e4x)...
knowing this I told him about my experiences. He then added memory
logging to his application. Although his leak was less rapid than mine
(he says with 1 minute refreshes he lost 1M or so per hour) he also saw
the issue. He then changed his application over to strongly typed
objects and noted that his memory leak had also been resolved. It was
at this point that I decided to publish the post in case it might help
others.
Scott
Alex Harui wrote:
I thought it was a performance issue only. I do expect sealed classes
to perform better than XMLLIstCollection (which does not convert to
object). I'll have to investigate further.
Always frustrating when misinformation get out there...
------------------------------------------------------------------------
*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
*On Behalf Of *Tracy Spratt
*Sent:* Saturday, August 25, 2007 11:47 AM
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] Memory leaks - binding to e4x XML?
I came across this article, wherein the author alleges that binding to
e4x XML objects cause memory leaks:
http://blog.fastlanesw.com/?p=14 <http://blog.fastlanesw.com/?p=14>
His arguments / findings, seemed well reasoned and supported, and I
do not have the background to refute them. Perhaps someone here might
discuss this.
Tracy
------------------------------------------------------------------------
*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
*On Behalf Of *Alex Harui
*Sent:* Saturday, August 25, 2007 2:21 PM
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] Memory leaks
There are two major memory usage scenarios in Flex. One involves
creating a new instance of a component, displaying, and later
destroying it. The other involves bringing in one or more classes of
components in a module and trying to get rid of that module later when
its classes are no longer needed.
Honestly, I don't know of any issues of the first kind at this point.
A major problem with ViewStack related components was addressed in
Hotfix2, and a DateField issue was either addressed in the same
hotfix, or a workaround was provided and the issue fixed for Moxie. A
recent issue with Menus was fixed for Moxie and a workaround was
provided. I'm sure there are still issues out there, and they should
be filed as bugs so we can investigate and fix them. I also encourage
you to try to isolate problems of this nature and post examples on
this forum as often there can be a misunderstanding of how memory
management works in Flash/Flex.
The second kind of issues is sort of a fact-of-life for Flex. The
first module to introduce shared code via Styles or Managers must
remain in memory to serve all other code. This has been explained on
my blog.http://blogs.adobe.com/aharui/2007/03/modules.html. The blog
article includes an example of a way to deal with this situation,
although often the easiest way is just to include all managers in the
main app, and bring in styles via runtime CSS.
As you'll see in the article, browser memory management has little to
do with it. It simply has to do with how GC works (described further
elsewhere on my blog) and how styles and singleton managers are
shared. Any memory changes when minimizing is probably due to IE
releasing its own browser resources, although the player may release
some at that time as well.
If you have further questions, this forum should be able to help you
out. In the future, please ask sooner before you spend time creating
eloborate infrastructures.
-Alex
------------------------------------------------------------------------
*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
*On Behalf Of *André Rodrigues Pena
*Sent:* Saturday, August 25, 2007 10:44 AM
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] Memory leaks
Hi all,
It might be a well-known that Flex has several memory issues. It
doesn't completely free the memory of the components you add runtime,
when you remove them from their containers, and when it comes to
large-scale applications, this is a huge concern. The way my
co-workers found to pass by it was to create a Javascript/Flex
framework to allow Flex to load modules in separate HTML frames and
provide communication between them. So, when a module gets out of
scene, the browser frees the entire SWF. But this approach limits the
user interaction like drag-n-drop support between modules. It's not
natural.
It seems that the browser may have a great part of the blame. They
realized, for instance, that Internet Explorer releases the memory
when the window is minimized and FireFox doesn't.
I'm here to ask what else can be done regarding memory issues. And how
you professionals have dealt with it.
Thanks
--
André Rodrigues Pena