Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A V8 bug that cause Node.js(and also V8-related browsers and APPs) memory leak
let create_leak_class = () => {
function Leak() {
//call an unused prototype method
this.unused();
}
Leak.prototype.unused = () => {
//do nothing
};
return Leak;
}
let loadTest = () => {
let Leak = create_leak_class();
let test = new Leak();
};
while (true) {
loadTest();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment