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)
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
npm install -g node-gyp
npm config set python python2.7
npm config set msvs_version 2017
npm install -g node-gyp
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
-
http://itindex.net/detail/52929-chrome-%E5%BC%80%E5%8F%91-%E5%B7%A5%E5%85%B7
-
https://www.cnblogs.com/xieqianli/p/12619886.html
https://www.dazhuanlan.com/2019/11/17/5dd086947a265/
This blog uses memwatch-next , a memory monitoring package;
But my installation failed, causing the project to be reinstalled. If you want to use it, please be careful!
The second tool: easy-monitor (recommended)
npm install easy-monitor
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/')
https://zhuanlan.zhihu.com/p/257854926 (good text)