Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: 1 2 [3]
Print
Author Topic: Fabrication 0.4 released  (Read 52812 times)
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #30 on: November 05, 2008, 07:29:43 »

Thanks Darshan, I really appreciate the help. I had a rather sleepless night last night fearing my project just went up in smoke with this problem :)

I'll continue to dig through things and see what I can find. Until I can resolve the issue I'm not comfortable moving forward in my project, so I'll try to help as much as I can. One thing that is frustrating me, and I think this is a Flex problem, is when I'm debugging I often can't inspect things like ModuleAddress and many other properties in the debugger. They show a folder to open, but when I click to expand it's empty. Again, I think this is a weird Flex thing since I don't get the same issue when using the Flash debugger.
Logged
Anty
Newbie
*
Posts: 4


View Profile Email
« Reply #31 on: November 05, 2008, 04:33:21 »

Hey guys,

I wanted to thank you both for the awesome job on Fabrication. I understand the concept of pipes and all but it was just too complicated to implement with several modules. Then I stumbled upon your framework and it helped a lot.

In regards to the problems of GC modules, maybe you haven't seen that already but there is a bug with Flash Player 9 : it doesn't really GC when it should do so upon dynamically loaded SWFs. Basically, the unload() method destroys the reference to the SWF but lets it run anyway. Without reference, it is very likely that the GC will miss sweeping the SWF.

The good news, well sort of, is that Adobe added a new method called unloadAndStop() that attempts to resolve some of the problems described by Grant Skinner. It is only available with Flash Player 10.

This problem may end up being a huge one for my project as I'm building a mid-sized Flash web site and I thought I'd break it into several swfs, one for each section. Well now I'm wondering if I should revert back to single core...What a pain.

I hope it helped and wasn't totally out of line. :D
Logged
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #32 on: November 05, 2008, 05:50:33 »

A lot of the problems concerning the loading/unloading of SWF's in FP9 have to do with Time line based code, which our project has none of (it's basically pure AS3 just a document class). In the case of Fabrication, as long as all the references are cleared from both the parent and loaded swf it should get GC'd. Of course you also need to ensure any other code in the swf gets cleared. One thing that can catch people up is that a loaded swf's STAGE property is actually the parent containers stage (there's only one stage in flash, regardless of the depth of loaded swf's) and adding listeners to stage can cause issues for GC.

They have done a great job in fix this and other issues related to unloading swf's in FP10. The only problem is that Flash 10 won't be out for some time yet and most developers won't be able to target Flash 10 until a reasonable adoption level is reached. Typically for our company it's one year AFTER the release of a new Player. I know, it sounds excessive but our apps, and clients, require that everyone be able to access them without having to upgrade or be diverted in any way. Our media player alone is displayed on over 30,000 websites and receives millions of hits a day... and it's still FP6 compatible :( Convincing them to let me move to 9 for our new media player was hard enough, I'll never get them to allow moving to FP10 right away.

I've read most of Grant's posts concerning GC issues. I'm glad adobe listen to him and made changes, I just wish they would have implemented those changes in 9 instead of putting them in 10.
« Last Edit: November 05, 2008, 05:52:41 by jasonmac » Logged
Anty
Newbie
*
Posts: 4


View Profile Email
« Reply #33 on: November 05, 2008, 06:58:10 »

My thoughts exactly, though I do not have a player delivered to thousands of websites. :p

There is a solution that is likely to work (but it's still random) : you wait till your module is supposedly clear of any reference and then force a GC upon the application. Found on Simon Bailey's blog.

I read on the blog of Skinner that "You can load content SWFs from a subdomain. This will place it into a security sandbox implicitly". Though I wonder if it could affect communication between the app and the modules...
Logged
Darshan Sawardekar
Sr. Member
****
Posts: 85


View Profile Email
« Reply #34 on: November 05, 2008, 10:07:50 »

Hey Anty,

While I agree that the player 9 does not have means to gc. However as Jason used in his example, doing 2 local variable LocalConnection's back to back seems to force the player to do an immediate gc. Jason was doing it in his example and without Fabrication it shows the drop. Google chrome shows this quite clearly.

So I wouldn't give up on the multi-modular approach just yet. ;-) Solid garbage collection is a hugely important feature for Fabrication moving forward. Like I mentioned earlier nearly every class cleans up after itself. The gc issue is almost fixed, look out for a new release soon. And I am working on modifications to the simple_routing example to show that it actually does work!

Jason,

Regarding the debugger are you using it against the source version or the swc? With the source version I haven't seen this issue.

peace,
darshan
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #35 on: November 06, 2008, 05:33:26 »

Hey folks, definitelry check Simon's blog. http://newtriks.com

He and I worked together (well he's the one that actually got exausted, I just provided moral and technical support :)

Anyway, he has a good MultiCore GC demo.

@jasonmac, the deal on your debugger and inspection of vars is you need to go to the little 'down arrow menu' on the right hand side of your variables view, and do Flex->Show inaccessible member variables

-=Cliff>
Logged
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #36 on: November 06, 2008, 05:57:35 »


@jasonmac, the deal on your debugger and inspection of vars is you need to go to the little 'down arrow menu' on the right hand side of your variables view, and do Flex->Show inaccessible member variables

-=Cliff>

Ah, thanks Cliff... that did the trick. I'm still getting used to Flex builder.
Logged
Anty
Newbie
*
Posts: 4


View Profile Email
« Reply #37 on: November 06, 2008, 08:07:23 »

You talking about something Simon hasn't posted yet Cliff ?

I've got another question : if there's a FlexModule, why isn't there a FlashModule ? I bet I missed something but I don't want to have to subclass anything related to Flex since my front end is AS3 only. Should I create a FlashModule class inspired by the FlexModule ? Any idea ?
Logged
Darshan Sawardekar
Sr. Member
****
Posts: 85


View Profile Email
« Reply #38 on: November 06, 2008, 08:59:38 »

Anty,

FlashModule is not needed when using flash. The FlashApplication is your entry point throughout. FlexModule is a flex specific fabrication because Flex makes a distinction between Applications and Modules. In the flash/pure as3 world there is no such distinction. A swf is a swf is a swf. ;-)

Checkout the hello_flash_with_module demo[1]. The navigation is a module loaded with a plain loader and extends FlashApplication.

peace,
darshan

[1] : http://fabrication.googlecode.com/svn/examples/hello_flash_with_module/
Logged
Anty
Newbie
*
Posts: 4


View Profile Email
« Reply #39 on: November 07, 2008, 11:25:29 »

Thanks Darshan, that's quite logical and simple indeed.
Logged
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #40 on: November 10, 2008, 08:56:00 »

Just checking in to see how things are going. Any luck on the unloading?
Logged
Darshan Sawardekar
Sr. Member
****
Posts: 85


View Profile Email
« Reply #41 on: November 11, 2008, 11:41:38 »

Hey Jason,

I have fixed the garbage collection issues. You need to grab 0.5 sources to get the fixes. Regarding your example, I have emailed you a modified version of your file with the fixes. The file is too big to post here and my blog's upload limit is only 2mb...

peace,
darshan
Logged
Pages: 1 2 [3]
Print