Brendan Eich tells how to prevent JavaScript memory leaks

The JavaScript founder details where developers can go wrong and the straightforward methods to stay on track

By , InfoWorld |  Software, JavaScript

Brendan Eich

There is a pirate in all of us including the man himself.

flickr/jsconf

JavaScript is a staple of the Internet, serving as an object-oriented scripting language for Web development, implemented in browsers. Although JavaScript has automatic memory management, it can have issues with memory "leakage," which can harm program performance. The issue is widely known, but it still is a common failure in JavaScript apps.

To help developers, InfoWorld Editor at Large Paul Krill asked JavaScript founder Brendan Eich how to deal with and prevent these memory leaks.

[ How much do you know about this stalwart developer tool? Find out in the JavaScript IQ test. | InfoWorld's expert contributors show you how to secure your Web browsers in this "Web Browser Security Deep Dive" PDF guide. | Stay in touch on all the key issues in programming with InfoWorld's Developer World newsletter. ]

InfoWorld: What is your view on the issue of JavaScript memory leaks?

Eich: JavaScript has automatic memory management, typically via garbage collection. This does not preclude leaks in practice, but it makes them unlikely and relieves developers from having to worry too much. Memory leaks introduced by bugs in the JavaScript engine are rare, but they can still result from buggy JavaScript implementations that contain internal memory leaks. These are browser bugs to report and fix.

Mozilla and other browser vendors are diligent about fixing these as they come up. Internet Explorer 6 had notorious internal leak hazards (closures as DOM event handlers), but Microsoft fixed them in IE9 and IE10.


Originally published on InfoWorld |  Click here to read the original story.
Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

SoftwareWhite Papers & Webcasts

Webcast On Demand

HP DevOps KnowledgeVault

Sponsor: HP

See more White Papers | Webcasts

Answers - Powered by ITworld

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question
randomness