-
-
Save Matt-Esch/21b2766fab8b30300c6e to your computer and use it in GitHub Desktop.
Leaking memory due to timer unref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var setTimeout = require('timers').setTimeout; | |
var work = 0; | |
setTimeout(function loop() { | |
var timer = setTimeout(function () { | |
work += 1; | |
loop(); | |
}, 0); | |
timer.unref(); | |
}, 0); | |
(function keepalive() { | |
setTimeout(function () { keepalive(); }, 1000000000); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment