Google open sources Leak Finder for JavaScript

Summary

Google has open-sourced Leak Finder for JavaScript, a new tool designed to identify unintended object retention in JavaScript programs that can lead to memory issues. Leveraging Chrome's Developer Tools remote inspecting protocol, it analyzes heap snapshots to pinpoint objects that meet a defined "leak" criteria. By default, Leak Finder targets goog.Disposable objects that haven't been properly dispose()d, such as goog.EventTarget instances, which can inadvertently keep event listeners and associated DOM elements alive. Developers can customize the tool's configuration to detect other specific patterns of object misuse beyond the default settings.

Google recently open sourced a tools for finding memory leaks in JavaScript programs.

In JavaScript you cannot have "memory leaks" in the traditional sense, but you can have objects which are unintentionally kept alive and which in turn keep alive other objects, e.g., large parts of DOM.

Leak Finder for JavaScript works against the Developer tools remote inspecting protocol of Chrome, retrieves heap snapshots, and detects objects which are "memory leaks" according to a given leak definition.

The default configuration of the tool detects goog.Disposable objects which were not dispose()d. goog.EventTarget is a subclass of goog.Disposable, and if an EventTarget is not disposed, event listeners are not discarded properly, and event listeners in turn keep DOM objects alive. It's possible to configure the tool to detect other similar misuses.

You can find more details about this project here.

The code location for this prokect is : https://code.google.com/p/leak-finder-for-javascript/source/checkout

JAVASCRIPT GOOGLE OPEN SOURCE

  RELATED

  COMMENTS

0

No comment for this article.