November 25th, 2009

Memory Management: Use the Lightest Classes You Can.

David and I have been teaching Flex at a local college.  Recently David mentioned to a student that he should use a lighter-weight class for a mask than Canvas.  The student asked why.  This brings up a good point.

When you’re using various Flex framework classes, you need to stop and think.  Do I really need the class I’m using or can I get away with something smaller.  One good example is when you’re creating custom MXML components.  Many times a rookie developer will create an MXML component with a Container as the root component when all they really need to do is to make a UI Control the root component.

In the case of the question, when using a mask, a very lightweight class the Sprite could have been used if the student had not needed the mask to participate in the display list.  Otherwise, they could have used a custom class based on UIComponent, vs using the larger Canvas class.

Just to re-enforce David’s point, I created a little POC where I created three custom classes, one based on Canvas, one based on UIComponent, and one based on Sprite.  I did not create any custom code in these classes, they were simply used so that they’d be easier to call out in the Flex Builder Profiler.  Then I profiled the application and here’s a screenshot of the results.

As you can see, there can be significant memory impact when you use classes that are more robust than you need.

That being said, pay attention to the classes you use in your code, and always stop to think, do I really need to use this class, or can I get away with something that is lighter-weight?

November 10th, 2009

My first Devnet Article: New Debugging and Profiling Features in Flash Builder 4 beta

I was approached a couple months ago to do a feature on Flash Builder 4 debugging and profiling.  The key was to illustrate the new features and enhancements and to offer nice concise walkthroughs.  So, without further ado, check it out!

http://www.adobe.com/devnet/flex/articles/flashbuilder4_debugging_profiling.html?devcon=f7

October 8th, 2009

Slides and Demos Now Available, MAX 2009: FP/AIR Performance and Memory Management

Thanks to all who stayed till the last session of the last day of MAX 2009 to watch my talk “Tackling Memory and Performance in Flash, Flex, and Adobe AIR“. I hope it was worth your while!

Thanks to Jonathan Campos for working together with me on prepping the session on short notice during MAX and talking at the Tuesday session, it was an honor, and pretty fun too.

Here are some links to the assets:

1. Slides/Resource link PDFs

2. FXPs of the demos I used during the talk

3. Resource links page online

Also, for those that couldn’t make it, here’s a screen cast of the presentation which is embedded below.

June 2nd, 2009

Eclipse Tweaks: Monitor and run garbage collection on your Eclipse memory heap.

So I was modifying the perspective associations in my Eclipse preferences this morning and ran across something very useful in the Eclipse –> Preferences… –> General.  It’s a checkbox called “Show heap status” that allows you to show the Eclipse memory heap status in the bottom right corner of your workbench.

Also, after showing it to my coworker Jamie…hey Jamie, get a blog dammit…Jamie noticed that you can click on the garbage can to run garbage collection on your Eclipse heap.

My heap was at 109MB and when I clicked the garbage collection button, it went down to 79MB.  Pretty slick and it just goes to show what you’ll find when you’re paying attention! ;-)

Below you can see the preference screen that contains the checkbox in addition to the actual widget it enables.

Enabling Show Heap Status in Eclipse

Enabling Show Heap Status in Eclipse

February 21st, 2008

Two business days till 360!

If you’re not registered, talk to your boss and get your butts down to 360 Flex!

http://www.360conferences.com/360flex/

There’s gonna be parties upon parties, open forum sessions, awesome presentations, and big announcements.

I’ll be there presenting a 201 level on Memory Management and Optimization. Also David will be there talking about Flash Video in Flex…remember we got HD now. :) Plus, we’re co-sponsoring the USB Drives, and seeing the comp they’re gonna look HOT!

Now, if you’re feeling like a 201 presentation on Memory Management and Optimization and you want to cover something specific, I’m taking suggestions. If it’s a legitimate topic and I have time to get it rolled into my presso I will…

Anyway, feel free to comment this blog with your ideas.

On a closing note: get registered, and get down to ATL!

August 31st, 2007

REDbug Beta 0.2 for Flash, Flex, and AIR debugging

For those of you that like trying out AIR apps as they come out, REDbug is an app that you can use while debugging Flash, Flex, and AIR applications. Although Flex Builder has some very robust debugging tools built in, there are times when you don’t have Flex Builder, or times when you don’t or can’t run your application in debug mode…for times like these, there’s REDbug.

So, for those of you new to REDbug, come check it out.

For those of you that have been using REDbug since Beta 0.1, it’s due to timeout at midnight Sept 1st…I am happy to say that the new version 0.2 aka 0.1.1 aka Jack Bauer is online and should seemlessly install the next time you open REDbug Beta 0.1.

Happy debugging!

August 29th, 2007

UPDATE: REDbug Beta 1.x codename Jack Bauer – Coming soon

Yesterday I mentioned pushing a new version of REDbug.

I had the new version exported and ready to go…the auto-update tested and working on my testing server…then I realized that I might be having an issue with MIME type setting for AIR on the production server. Sadly, I do not have admin rights to my production server for making modifications such as setting MIME types…and therefore need to make a change request with the powers that be.

So, I’ll be working to get the update out, preferrably before the Sept 1st timeout, and will keep you posted…

damit!

August 28th, 2007

REDbug Beta 1.x codename Jack Bauer – Coming soon

For those of you using the current REDbug beta 1, there is a timeout build into the beta that will cause the app to stop working at the end of this month. Damit! The good news is that I will be pushing the new version up to the server within the next 24. Thanks to Adobe, we can make use of the auto-update feature, good work Adobe!

So here’s how it *should* go down:

1. I push up the new version of the app within the next 24.

2. Next time you open the app after I’ve pushed up the new version, the app *should* notice it and try to update itself.

3. Once the app has updated you will be good to go until the next beta is released, no need to worry about the expiration mentioned above.

Now, you’ll notice I said it *should* update. Damit!
The *should* comes with the territory of not only AIR being beta but REDbug being beta…so, if it doesn’t work as mentioned above please post a bug to the bug submission form at the REDbug Site. Oh and regarding bug posts, like all Flex/AIR shops, our resources are stretched pretty thin right now so any testing and bug posting done by the community is most appreciated…as a matter of fact, I will be announcing some pretty cool things for bug submitters when Beta 2 comes out…more to come!

Chloe? I need another favor…

August 21st, 2007

360|Flex Seattle – Memory Management for Flex and AIR Developers

In honor of the release of Bioshock today for the 360, I figured I would stop slacking and post the slides and sample code from my 360|Flex presentation. Also, I wanted to give big thanks to all the people that attended my presentation and didn’t fall asleep. ;-) Those of you that did…well, it was 8:30am and I wish I had been sleeping too!

Now, regarding the sample code and slides, a couple notes:

1. I am running Flex Builder 3 Beta 1. The zipfiles containing the code are exported FB3B1 Flex and AIR projects.

2. Although the client-side libraries are included in the project lib directories, for these samples to be halfway worthwhile and actually show memory statistics, you should download REDbug Beta.

3. If you want to do the things I did during my presentation to compare and contrast memory utilization within the samples, look at the TODO comments within the code. An easy way to do that is to use the awesome TODO/FIXME plugin tool many props to Dirk!

4. Although these samples are cool examples on how to compare and contrast deferred instantiation techniques, using the right components for the job, and finally to illustrate event listener memory leaks, they should in no way be construed in whole as best practices in building an app. Remember, examples only…to illustrate the key points regarding memory consumption as described in the TODO comments.

5. The module example is configured to work when you run the application, not debug the application. If you want to change that, you’ll need to either set the debug compiler option to true, or create an ant script to compile the module that’s in the project.

6. The link to the slides is actually a link to an Adobe presentation. I figured I’d give that format a try.

So…without further ado, some links:

Hope you find something useful…and if anything, rush over to your nearest game distributor and pick up a copy of Bioshock…I know I will be!

August 17th, 2007

REDbug Beta 1 – Site update

REDbug is a suite of tools used to log debugging information, flash player application environment information, and memory statistics. One module or another can be used with AIR, Flex, and older Flash applications.

For those of you that saw my memory management talks at Flexmaniacs or 360Flex, this was the tool that provided the cool and colorful memory utilization graphs.

The tool is currently in Beta 1, and we’ve recently updated the site to include downloads for the client-side libraries, and also some updated example projects to illustrate usage. So…if you’re interested, download it and check it out.

You can get to REDbug at it’s new URL –> http://www.redbugtool.com

« Previous Entries

Upcoming Talks





A Book I Helped Write



Community


Ignite Denver Committee

Categories

Credits