Skip to content

Simple methods to detect the source code causing memory leakage in garbage collected JavaScript Applications.

Notifications You must be signed in to change notification settings

BibekShah09/javascript-memory-leakage

Repository files navigation

Hunting Memory Leakage in JavaScript Application

Garbage Collection is the process by which the program performs automatic memory management by reclaiming the memory occupied by objects that are not used in the program. Memory leakage is defined as a situation when the memory not needed by the program is not returned to the operating system or pool of free memory. For more details refer Hunting Memory Leakage in JavaScript Application.

Prerequisites

Git
node
npm

Installation

git clone repo_name # or clone your own fork
cd repo_name
rm rf .git
npm install

Hunting Memory Leakage

1. Using Node inspector.

node --inpsect=9229 leakage.js 

on Chrome Browser open:

chrome://inspect

chrome_inspection


Then, load the snapshot

2. Using Heap Dump Module and Loading.

node snapShot/index.js 

Output file: heapdump-7369622.877796.heapsnapshot

Load the file using chrome inspector

3. Command Line Options.

node --expose-gc --trace-gc expose-gc.js 

For more command line options refer file command-lines.txt

Author

Bibek Shah

License

MIT

About

Simple methods to detect the source code causing memory leakage in garbage collected JavaScript Applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published