Mozilla tackles the browser memory conundrum

In Mozilla's Servo browser engine, a JavaScript garbage collector will take over DOM memory management

Mozilla's Servo browser engine project looks to improve DOM (Document Object Model) memory management, with the JavaScript garbage collector to be tasked with managing native-code DOM objects.

The approach would be an alternative to reference-counting for tracking pointers between low-level DOM objects, which can bring about complications like the leaking of memory objects. "We have a new approach for DOM memory management, and we get to use some of the Rust language's exciting features, like auto-generated trait implementations, lifetime checking, and custom static analysis plug-ins," say Josh Matthews and Keegan McAllister in a Mozilla Research blog post this week.

Giving the garbage collector responsibility for managing these DOM objects requires complex interaction between Servo's Rust code and the SpiderMonkey garbage collector. "Fortunately, Rust provides some cool features that let us build this in a way that's fast, secure, and maintainable," Mozilla's researchers said. Mozilla partnered with Samsung on Servo, which is intended to leverage multicore, heterogeneous architectures, and plans to productize Servo in the 2015 timeframe.

Memory management on the DOM is a real problem that has needed to be solved, concurs Forrester analyst Michael Facemire. But he doubted Mozilla's innovations could jump-start Firefox as it battles Google Chrome for market share: "That said, will this promote Mozilla above the likes of Chrome? Probably not, but I do believe it will advance the state of the art of browsers." Mozilla's Firefox browser has been losing market share to Chrome. July figures from W3Counter, tracking global market share, had Chrome at 38.5 percent, followed by Internet Explorer (21.2 percent), Safari (15.4 percent), and Firefox (15.2 percent).

Mozilla's researchers say it is "an open question" of how the garbage-collected DOM will perform compared to a traditional, reference-counted DOM. "The Blink team has performed similar experiments, but they don't have Servo's luxury of starting from a clean slate and using a cutting-edge language. We expect the biggest gains will come when we move to allocating DOM objects within the JavaScript reflectors themselves. Since the reflectors need to be traced no matter what, this will reduce the cost of managing native DOM structures to almost nothing."

This story, "Mozilla tackles the browser memory conundrum," was originally published at InfoWorld.com. Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

From CIO: 8 Free Online Courses to Grow Your Tech Skills
Join the discussion
Be the first to comment on this article. Our Commenting Policies