Closed MarTuPoke closed 11 months ago
2023-08-30T08:54:29.208(Beijing Time)
2023-08-30T15:33:29.831
2023-08-30T18:38:20.353
heapUsed is normal but non heap memory Getting bigger and bigger
The problem has been investigated and is not related to node
Details
My nodejs memory is getting larger and larger over time Both PM2 and Linux systemd cannot be avoided
So I first used heapdump to record the heap space size, but after my investigation, my heap space size has always been around 100MB, but my nodejs memory (rrs) will become larger and even reach 1GB+
Can you take a look at the heapsnapshot I provided
heapdump_2023_08_29_20_00_00__156.heapsnapshot.zip
After comparing some heapsnapshots, no issues were found, so I checked the memory situation through the OS of Nodejs. The code is as follows
2023-08-30T01:51:04.983(Beijing Time)
As time goes on, the non heap memory of my program will become larger and larger. I don't know how to troubleshoot it anymore. I need help with everything. Thank you!
I will add screenshots of the memory size for the following time in the future
Node.js version
Not applicable.{ node: '16.17.1', v8: '9.4.146.26-node.22', uv: '1.43.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.18.1', modules: '93', nghttp2: '1.47.0', napi: '8', llhttp: '6.0.9', openssl: '1.1.1q+quic', cldr: '41.0', icu: '71.1', tz: '2022a', unicode: '14.0', ngtcp2: '0.1.0-DEV', nghttp3: '0.1.0-DEV' }
Example code
No response
Operating system
Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-180-generic x86_64)
Scope
Memory leak
Module and version
"dependencies": { "@alicloud/sms-sdk": "^1.1.6", "@hapi/joi": "15.1.1", "@koa/router": "^12.0.0", "async-lock": "^1.3.2", "axios": "^0.27.2", "cron": "^2.1.0", "croner": "^7.0.1", "cross-env": "^7.0.3", "crypto-js": "^4.1.1", "dayjs": "^1.11.5", "easy-monitor": "^2.2.8", "eventasync": "^1.0.0", "exceljs": "^4.3.0", "heapdump": "^0.3.15", "ioredis": "^5.2.2", "koa": "^2.13.4", "koa-body": "^6.0.1", "koa-ratelimit": "^5.0.1", "koa-response-time": "^2.1.0", "koa2-validation": "^1.1.0", "log4js": "^6.6.1", "mqtt": "^5.0.3", "ms": "^2.1.3", "mysql2": "^3.6.0", "nanoid": "3.3.4", "node-cmd": "^5.0.0", "node-crc16": "^2.0.7", "nodemailer": "^6.7.8", "qiniu": "^7.8.0", "socket.io": "^4.5.2", "superagent": "^8.0.9", "vm2": "^3.9.11", "wechatpay-node-v3": "^2.1.0", "xml2js": "^0.4.23", "yaml": "^2.1.1" }, "devDependencies": { "@types/koa-router": "^7.4.4", "@types/xml2js": "^0.4.11", "nodemon": "^2.0.19" }