Node memory analysis tool heapdump and Easy-Monitor stepping guide (installation instructions + Baidu tutorial stepping pit)

It mainly involves the installation part and usage import
. The cause of the problem: Because of the multi-threaded concurrency, there is a memory leak, and the troubleshooting tool is used in the investigation. The tools
involved in this article: heapdump, Easy-Monitor,
both of which need to install python,
I also need to install the VS environment I have read a lot of tutorials, but please don't install without permission, please don't follow the commands ;
I helped you step on the pit! ! ! !
How to enter the administrator mode :
a simple way (windows10)
Insert picture description here
Insert picture description here

The following command will automatically install a suitable environment for you, but you have to be patient, and others have prompted, in the
administrator mode: But people like me who are waiting for use are impatient, so I stepped on the pit Step on the pit ~ So friends who have time should wait, don't try it lightly. **Fast internet speed and short time! **Friends who don’t have much computer storage space, believe me, your space will explode. The key is that you still dare not uninstall, right! ! ! So wait obediently, it's delicious. That's it! ! ! ! ! Continue to administrator mode: administrator mode configuration depends on administrator mode installation
npm install --global --production windows-build-tools
Insert picture description here



Insert picture description here
Insert picture description here

Insert picture description here

npm install -g node-gyp
Insert picture description here

npm config set python python2.7
npm config set msvs_version 2017

Insert picture description here
npm install -g node-gyp
Insert picture description here

The first tool: heapdump (not easy to use, the second is recommended)

This time to your project inside
installation Note administrator mode cmd into the project : 100% installation fails or the beginning I always thought it was a python environment, then look carefully, it reload the gyp, but this is not the administrator mode of ah , So how to install it, so, please note that you must use the administrator mode to enter! ! ! ! !npm install heapdump --save

Insert picture description here

Insert picture description here

Insert picture description here

The second tool: easy-monitor (recommended)

npm install easy-monitor
Insert picture description here

const easyMonitor = require('easy-monitor')
const http = require('http')
easyMonitor('testcz')

// let leakArray = []
// let leak = function () {
//   leakArray.push(new Array(10 * 1024).fill(0))
// }
http.createServer(function (req, res) {
  // leak()
  res.writeHead(200, { 'Content-Type': 'text/plain' })
  res.end('Hello World\n')
}).listen(8080)//你要监听的端口
console.log('Server running at http://127.0.0.1:8080/')

Insert picture description here
Insert picture description here

https://zhuanlan.zhihu.com/p/257854926 (good text)
Insert picture description here

Guess you like

Origin blog.csdn.net/OrangeChenZ/article/details/112540901