Created
February 26, 2019 02:45
-
-
Save lqqyt2423/864be5d3e7fd6309e8dd01e4ea0c3623 to your computer and use it in GitHub Desktop.
内存快照,通过chrome开发者工具查看内存快照
This file contains hidden or 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
'use strict'; | |
// kill -USR2 61365 | |
const heapdump = require('heapdump'); | |
const http = require('http'); | |
const leakArray = []; | |
const leak = function () { | |
leakArray.push('leak' + Math.random()); | |
}; | |
http.createServer(function (req, res) { | |
leak(); | |
res.writeHead(200, { 'Content-Type': 'text/plain' }); | |
res.end('Hello World\n'); | |
}).listen(1337); | |
console.log('Server running at http://127.0.0.1:1337/'); | |
console.log(`This process is pid ${process.pid}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment