2 Commits

Author SHA1 Message Date
DebaucheryLibrarian
33a327a04b Merge branch 'master' into experimental 2022-03-30 23:00:29 +02:00
DebaucheryLibrarian
ccb99e278c Added periodic memory logger. 2021-11-20 23:59:15 +01:00
2 changed files with 36 additions and 0 deletions

19
package-lock.json generated
View File

@@ -11650,6 +11650,25 @@
"webidl-conversions": "^3.0.0" "webidl-conversions": "^3.0.0"
} }
}, },
"node_modules/node-fetch/node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"node_modules/node-fetch/node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
},
"node_modules/node-fetch/node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/node-gyp": { "node_modules/node-gyp": {
"version": "7.1.2", "version": "7.1.2",
"resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz",

View File

@@ -85,6 +85,23 @@ async function startMemorySample(snapshotTriggers = []) {
}, config.memorySampling.sampleDuration); }, config.memorySampling.sampleDuration);
} }
async function startMemorySample() {
await inspector.heap.enable();
await inspector.heap.startSampling();
// monitorMemory();
logger.info(`Start heap sampling, memory usage: ${process.memoryUsage.rss() / 1000000} MB`);
setTimeout(async () => {
await stopMemorySample();
if (!done) {
await startMemorySample();
}
}, 30000);
}
async function init() { async function init() {
try { try {
if (argv.server) { if (argv.server) {