January 17, 2013, 10:20 AM —
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.

















