Are You Leaking What I’m Leaking

At The Supergroup we do a large amount of Flash development. If you have ever developed in Flash you have most likely run up against the problem of memory leak. This typically happens when you are loading in lots of image files into your application. You might have experienced this on a Flash image gallery. After viewing images for a while, the application gets bogged down and performs really badly.

Ok. This is going to get pretty dev-talky so read ahead with caution…

The problem comes from adding and removing things to the display list in Flash. Flash depends on something called the “garbage collector” to come along and clear things out of memory that are no longer in use by your program. This frees up your computer. Here are step-by-step instructions for how to get your memory clear without having to do a page refresh.

Removing Objects and Marking Them for Garbage Collection

First thing is to remove the objects from the display list and set them to null.

Example:

for(var i:int = 0;  i<images.length; i++){

images[i].unload();

removeChild(images[i]);

images[i] = null;

}

images = null;

You must remove anything that has a referential connection to the objects that you are removing or they will not be marked for garbage collection. As in our example, the images array holds a connection to each item in the array, so it must be removed as well in order to clear the objects from memory.

Here is a really good article about garbage collection.

Calling the Garbage Collector

Here at TSG, we did all that but there was no way of knowing if the garbage collector was actually coming around to pick up this trash. Instead of sitting there and seeing if the garbage collector would ever come around, we decided to try and call him up. We found two solutions:

1.  The first is to open two local connections (it’s a total hack, but it works):

try {

new LocalConnection().connect(’foo’);

new LocalConnection().connect(’foo’);

} catch (e:*) {}

2.  The second method is only available with the additional CS4 ActionScript libraries:

flash.system.System.gc();

Terence Trent D’SuperGroup

Terrence Trend D'ArbySo, a few of us here at The SuperGroup decided to have a cover song challenge, mainly just to share our INCREDIBLE musical abilities with the world (or at least each other). We decided that we’d do one that was a practice round, just to get our juices flowing, so to speak. So of course, we picked the best song of the 20th century from an album that is on par with Sgt. Peppers Lonely Hearts Club Band or Pet Sounds. That’s right, we picked “Sign Your Name” by Terence Trent D’Arby, off of the album Introducing The Hardline. The entrants were Elliott, and yours truly (James).

James’s version of “Sign Your Name”

Elliott’s version of “Sign Your Name”

CLEARly Fraud

CLEARHere at The SuperGroup, we do quite a bit of traveling for business, and like many frequent fliers, we were thrilled at the service that CLEAR offered:  Guaranteed fast and efficient airport security checkpoints for a nominal annual fee.  This setup allowed business travelers to be more productive and spend less time waiting in lines at the airport.  Even the technology was cool, with retina scans straight out of a James Bond movie!  For a time, things were swell.

Unfortunately, this morning, CLEAR members received the following email:

At 11:00 p.m. PST today, Clear will cease operations. Clear’s parent company, Verified Identity Pass, Inc. has been unable to negotiate an agreement with its senior creditor to continue operations.

To say that this was unexpected news is an understatement – just days before, CLEAR was running Fathers’ Day promos and encouraging their customers to renew their memberships.  I even read one account that said a customer who’d received this notification had to tell the CLEAR employees at JFK airport that they were out of a job – apparently, they hadn’t gotten the memo.

Here at TSG, we’re pretty ticked off.  Not just because a valuable service is no longer available, but because the situation is CLEARly fraud.  More importantly, according to the small print, the personal data collected by this company can be “shared” with other entities.  Ouch.  We were duped along with 250,000 others.  My crystal ball foretells: Lawsuits.

If you’re feeling the pain too, my advice is to dispute the charges with your credit card company.  And if you happen to personally know one of the executives responsible for this, give’m a swift kick in the ass on behalf of all of us here at TSG.

Calorie Gallery

Calorie Gallery is a pretty great new site that allows you to search for different foods and see a visual representation of how many calories are in a normal serving size.

You can search by typing of course, but you can also search by clicking through various images or categories.  One of the really neat things is the pages for each item are interactive, so you can adjust serving sizes, and other information, and the page dynamically adjusts representations about how to burn it off.

iPhone Painting a Day

Intergalactic PaintingA couple weeks ago, I got the Brushes app for my iPhone.  This incredible little app allows you to make digital paintings by touching and dragging your finger around on the screen.  It’s a very simple interface and has three brushes (all adjustable sizes), a color picker, and a way to adjust the opacity.  As someone who only occasionally doodles, I quickly fell in love with this app.  It’s like carrying around a tiny canvas with you along with a full palette of paints and brushes, and what’s more, is when you are done with your painting, you can grab it on your computer as a hi-res png or jpeg image AND a time-lapsed quicktime video of your work.  I decided to try my hand at making one of these every day, and don’t see myself stopping anytime soon.  I don’t know if I’m particularly good at painting, but it’s a ton of fun.  Check out the iPhone paintings that I’ve created so far.