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
Loading Flex apps into Flash (AS3)   Message List  
Reply | Forward Message #109455 of 149622 |
RE: [flexcoders] Memory leak -Debug version Flash Player - Re: Loading Flex apps into Flash (AS3)

A way to explicitly put content in a separate SecurityDomain would be a good thing.

 

I’ve definitely seen an object with weak reference enterFrame listeners go away when GC’d.  Maybe it doesn’t if it came from another SWF.  Hopefully, Grant or somebody filed a bug on that so it can be examined and fixed if it is a problem.

 

Having a way to punt something or forcibly shut it down would be a good thing too, but it might be harder than it sounds.  Maybe the player team will find a great way to deal with it, but one of the reasons AS3 runs so much faster than AS2 is that the VM verifies an entire method before running it, and it doesn’t check at each instruction in the method to see if references are still good.  AS2 spent time doing that check at each instruction, and you pay for it when at runtime.

 

IMHO, AS2 let you write a bunch of bad code and get away with it.  Excellent from a prototyping perspective, but not how I would want to develop large frameworks or applications.  I’m willing to put up with overhead of being careful to release references when I’m done with something, adding protocols to handshake between child swfs, etc. because then there are fewer mysterious behaviors.  Everything is more predictable.  For example, I probably wouldn’t use weak reference enterframe listeners, I would probably use a strong reference listener and a REMOVED_FROM_STAGE handler to remove the listener so I know that if that object is skipped by GC, it won’t be eating CPU cycles and then when I go to debug it, it does get picked up by GC and the problem goes away.  Yes, it is more code, but I think it is better code.

 

Whenever you host third-party content, you either have to completely trust it or not.  The degree of non-trust you have for it dictates how open you are to betrayal.  If you don’t trust it at all, I’d put it in another player instance.  If I think I can trust it, or have time to figure out it is well-behaved, I’d put it in another securitydomain.  If I’m sure I can trust it, then I can load it into my securitydomain.  It’s one thing to meet a stranger and let him/her stay in a separate guest cottage and keep your doors locked, it is another to let them stay in your house and lock your bedroom, and yet another to let them stay in your bedroom.  And don’t get fooled by how nice and/or sexy they seem when you meet them J

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of bick
Sent: Wednesday, April 09, 2008 12:29 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Memory leak -Debug version Flash Player - Re: Loading Flex apps into Flash (AS3)

 

Check out this article by Grant Skinner. Alex, any thoughts on this?

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

--- In flexcoders@yahoogroups.com, "bick" <sbicksubscript@...> wrote:
>
> After further testing, we are finding that the memory leak *only*
> occurs if using the debug version of the Flash 9 Player. It never
> occurs w/ the non-debug version.
>
> Has anyone else experienced memory leaks w/ the debug version?
>
> What's the install base of the debug versus normal version of the player?
>



Wed Apr 9, 2008 9:11 pm

alex_harui
Online Now Online Now
Send Email Send Email

Forward
Message #109455 of 149622 |
Expand Messages Author Sort by Date

I have an AS3 Flash app that successfully loads a very simple Flex app into a movieClip contained in the Flash app. There's a button that unloads it. And...
bick
Online Now Send Email
Apr 6, 2008
10:17 pm

Looking in the debugger I see 5 new WeakMethodClosure listeners on the stage each time the Flex app is loaded. Unloading the Flex app does not remove these. ...
bick
Online Now Send Email
Apr 7, 2008
5:12 am

A weak method closure with no backreferences can be a false positive from the profiler. If you are going to be loading just a few apps, the WMCs should be...
Alex Harui
alex_harui
Online Now Send Email
Apr 7, 2008
5:37 am

After further testing, we are finding that the memory leak *only* occurs if using the debug version of the Flash 9 Player. It never occurs w/ the non-debug...
bick
Online Now Send Email
Apr 9, 2008
1:58 pm

I have an AS class name Module binded to java class Module like this : package test { [Bindable] [RemoteClass(alias="test.Module")] public class Module { ...
Emmanuel Potvin
epotvin@...
Send Email
Apr 9, 2008
2:37 pm

Check out this article by Grant Skinner. Alex, any thoughts on this? http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html ...
bick
Online Now Send Email
Apr 9, 2008
7:29 pm

A way to explicitly put content in a separate SecurityDomain would be a good thing. I've definitely seen an object with weak reference enterFrame listeners go...
Alex Harui
alex_harui
Online Now Send Email
Apr 9, 2008
9:11 pm
Advanced

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