Better Memory Management Tools for Web Apps Coming Soon


Developing a “web 2.0″ application brings with it a host of new challenges previously unfelt or easily ignored with older, single-page-load-per-action apps. The browser has evolved from a simple page renderer to an application platform that busily executes JavaScript and receives, parses, and displays loads of new data without ever leaving the page. Developers are now struck with the challenge of ensuring their applications manage memory properly and efficiently—your JavaScript can leak memory, killing the user experience on your site, but also impacting the user’s complete experience with their system across the board.

To date, it’s been a bit of a struggle to manage memory, since developers are essentially forced to rely on their operating system’s memory managers to even monitor the memory usage of their browser. Even then, testing can be frustrating, as Firefox, for instance, stores all tabs in the same process. Google Chrome is multi-threaded; each tab is its own process. Chrome also features its own built in task manager, so you can identify which page is using exactly how much memory, CPU, and bandwidth. Even at its most detailed, the stats available only show aggregate memory and virtual memory usage—these abstract figures make troubleshooting individual pieces of your code difficult to say the least.

The folks over at Mozilla’s Developer Tools Lab are looking to change that by building a memory analysis tool that helps devs understand exactly how their application is using memory, and the behavior of the cycle (garbage) collector:

We plan on the initial implementation of this tool to be simple. For memory usage, we want to introduce the ability to visualize the current set of non-collectible JavaScript objects at any point in time (i.e., the heap) and give you the ability to understand why those objects aren’t collectible (i.e., trace any object to a GC root). For the cycle collector, we want to give you a way to understand when a collection starts and when it finishes and thus understand how long it took.

Ben Galbraith and the team are soliciting help and feedback, so if this is an issue you’ve had to deal with in the past, make sure you comment.

A New Memory Tool for the Web | Ben Galbraith’s Blog via Ajaxian

Reblog this post [with Zemanta]

Posted in: Cool Stuff, Development

The Lazy, Clever Programmer: A Compendium Of Code Reuse & Recycling

I started getting “serious” about development because I had a desire never to write lengthy, wandering streams of code again.  It was not for any reason but unadulterated laziness—the kind that so overpowers the better senses as to force a person to spend hours in a chair with the express goal of not spending hours in said chair.  It’s a wild, consuming laziness that seems to know no bounds.

As developers, once we start separating our code into abstract ontological typologies, we make use of the human mind’s phenomenal ability to work with types.  Our code becomes less about jump tables and registers and more about users, email messages and images.  What once was a problem of allocating resources and operations within the computer becomes an abstract, logical problem within a collection of objects.  Like children awe-struck by stories of magicians of old, speaking incantations and pressing their wishes into reality by the power of their mind alone, we become drunk with the sense of awe and possibility.

We *really* dive into things after the jump, so go ahead and hit it.

Read More »

Posted in: Articles, Development

HTML 5: New features, tags, attributes and what else to expect (in about a decade)

HTML 5 is coming our way. So goes the theory, anyway. (Recent chatter puts widespread adoption by user agents at close to a decade out from now… or more.) It is still a moment that many of us are eagerly anticipating. I remember drooling over my keyboard while reading through the HTML 5 Specifications the first time. We have been stuck with HTML 4.01/XHTML 1.0 for a long time and it is time to see some changes.

(In fact, HTML 4.01 has presented us with the longest gap in HTML revisions—it’s been 10 years since it was released; HTML 3.2 only lasted about a year, from 1997 to 1998.) There are some great things we have to look forward to that will make life a lot easier for us developers and designers. We’ll take a look at a few of them after the jump.

Read More »

Posted in: Design, Development, Tech News

Handling State in Multiple Windows and Flaky Connections

The Interweb is a wonderful place to host complex web applications as long as you’re tethered to it by Cat5 and an ISP that has your back (Communism works out in this scenario as well). But that’s not the world we live in, and in all other cases using web applications from mobile platforms can be a new circle of Dante’s Inferno below that ice one.

The trouble with web applications on mobile platforms is two fold. First, displaying data for mobile devices is a problem in and of itself, for which I will say nothing more about in this article. Imagine users with laptops and tablet-PCs. The second and more interesting problem revolves around maintaining state and managing client server interactions in an environment where spotty network coverage and ambient radio noise are totally messing with your stuff.

Read More »

Posted in: Design, Development, How To

Using CSS Sprites to Create Easy Image Rollovers: A Tutorial

In this tutorial, I’ll show you how to quickly and easily use single images and a bit of crafty CSS to create easy image rollovers. You can also use this technique to simplify browser caching of your images by storing multiple images in a single “meta image”, so to speak. (There are some reasons not to do this, though.)

I don’t know if the creators of CSS were thinking of sprites (more on that later) when they thought of the background-position property [Never doubt the range of "what if" thoughts of those who created CSS—Ed] but thanks to many innovative CSS users, we have an excellent way to reduce the load times of our pages. Check it out, after the break.

Read More »

Posted in: Design, How To Making it easy to jazz up your UI

There are plenty of resources for code snippets and quick-and-dirty ways to accomplish all sorts of things in JavaScript. Back before AJAX achieved any sort of prominence, they were all form validators, alert systems, calculators and the like. Now that AJAX has hit the “Web 2.0″ scene in a big way, (in large part typifying the “Web 2.0″ application interface) more and more users are clamoring for ways to add those cheeky interface elements that they see on Flickr and elsewhere to their own attempts at the web.

We make pretty heavy use of YUI and occasional use of Prototype and Scriptaculous, all various forms of JavaScript frameworks/libraries that save us time and effort by packaging up neat effect calls and components into easily digestible chunks, while making the JS we write sane again.

The script samples here don’t do any of that cool stuff but they provide a quick and dirty starting point with some nice guidance to get in there and start AJAXing your site.

Worth a look, at least, but perhaps only if you have *some* familiarity with JavaScript basics. No? Alright, dive right in. Just be sure to test across browsers. via Lifehacker

Posted in: Cool Stuff, Design

Workaround to Gmail Manager Firefox Extension

Ever since we made the switch from hosting our own mail servers to using Google Apps for Domain, one of the Firefox extensions that I use on a daily basis is Gmail Manager. It allows me to easily view the inboxes for various email accounts that I monitor and gives me the ability to quickly launch any of those accounts into a new tab. The only problem is that the extension author hasn’t made any updates to it since 2007. While this wouldn’t normally be too big of a problem, Google in their infinite wisdom has decided to rename the username and password login inputs.

The result of the name change by Google caused the extension to stop retrieving email and auto-logging me in to the accounts. It wasn’t until I got suspicious of the fact that it didn’t appear that anyone was emailing me for a few hours that I decided to manually log in and investigate. Once I determined that the extension had broken, I went to work trying to track down an updated version or a quick fix to get it back in action. What I found was a forum for the extension with over 100 pages of messages in it.

Read More »

Posted in: Rants