tags:

views:

1535

answers:

5

I would like to make apps that can run in a flash enabled browser and decided flex would be best for me so I started to learn that. AFAIK flex has a GC but how that GC works compared to the ones in other languages I've seen may be a bit different. I have found this but apparently there is (or were) huge memory leaks that could not be prevented and a lot worse when run in IE.

Is flex safe to trust now. Have any leak that were there been fixed?

A: 

A couple resources you can have a look at are : Flex Bug Tracking which you could peruse for memory leak bugs that have been fixed/logged. Also in the Flex Builder IDE you can use the Profiler to monitor memory/CPU usage etc. I cant specifically answer your question. I think that part of the responsibility here is on you, the developer, and how you have designed and managed your code. Apart from that, I have noticed using the Flex 3 framework (or ASVM2 in general) that it has done a good job of managing the GC for me. Keep in mind as well that Flex 4 is around the corner.

jpencola
+3  A: 

Hi. I work on a fairly large and complex Flex3 app, and we haven't had any terrible or uncontrollable memory leaks - even in IE.

This post by Grant Skinner on garbage collection in AS3 was very helpful to me. It was posted in 2006, but it's still entirely relevant (as we're still using AS3). It's part of a three-part series he did on resource management - there are links to the associated articles in his post.

http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html

Something to understand/remember is that Flex apps run in the Flash Player - maybe you're clear on that, but I don't think it's entirely obvious if you aren't coming from a Flash development background. At least, I don't think it would have been for me. :)

Ross Henderson
A: 

In my experience, Flex 2 will leak significant memory over time, especially in Firefox 2. I'm not sure about Flex 3.

johnbr
+2  A: 

There is an Adobe DevNet article that was published describing Flash Player Garbage Collection:

http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html

When you program in ActionScript your biggest concern related to memory is making sure that you do not keep references around to objects that are no longer needed. For example, when you add an event listener make sure that you also remove that event listener when it is no longer needed (or learn how to leverage weak references).

In my experience the Flex Framework is generally good at this type of memory bookkeeping. The memory footprint of your application will come down in part to how well you code with the garbage collector in mind.

If you do encounter issues with ever increasing memory, you can leverage the Profiler to take and compare memory snapshots in order to find leaking objects. You can find information about the Profiler here:

http://livedocs.adobe.com/flex/3/html/profiler_1.html

darronschall
A: 

People at my job say there is a bug with ComboBox and autocomplete Event.