-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
代码
function printMemoryUsage(tag = '') {
const used = process.memoryUsage();
console.log(`\n--- Memory Usage ${tag} ---`);
for (let key in used) {
console.log(`${key}: ${(used[key] / 1024 / 1024).toFixed(2)} MB`);
}
}
var faker = require("./nodePlug/faker");
for (let i = 0; i < 100000000; i++) {
let demo = ()=>{}
let [x1,x2] = faker.new_document_all(demo)
if (i%100000===0) {
printMemoryUsage();
}
[x1,x2] = [null,null];
demo = null;
}执行之后
--- Memory Usage ---
rss: 4215.17 MB
heapTotal: 4127.07 MB
heapUsed: 4038.40 MB
external: 2.28 MB
arrayBuffers: 0.02 MB
<--- Last few GCs --->
[25712:000002455DFF3000] 22823 ms: Scavenge 4060.9 (4134.1) -> 4060.1 (4135.6) MB, pooled: 0 MB, 6.10 / 0.00 ms (average mu = 0.210, current mu = 0.102) allocation failure;
[25712:000002455DFF3000] 22840 ms: Scavenge 4064.1 (4137.3) -> 4063.7 (4147.6) MB, pooled: 0 MB, 9.29 / 0.00 ms (average mu = 0.210, current mu = 0.102) allocation failure;
<--- JS stacktrace --->
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working