按以下文章进行操作:
https://github.com/felixge/node-memory-leak-tutorial
如果node 版本高于6.3.1,则继续参考:
https://github.com/node-inspector/node-inspector/issues/905
https://nodejs.org/api/debugger.html#debugger_v8_inspector_integration_for_node_js
关键点:
node --inspect index.js
node-inspector
$ node--inspect index.js
Debugger listening on port9229.Warning:This is an experimental feature and could change at any time.To start debugging,open the following URLinChrome:chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:9229/node
结果:
参考链接:
https://github.com/felixge/node-memory-leak-tutorial
https://nodejs.org/api/debugger.html#debugger_v8_inspector_integration_for_node_js
网友评论