mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
4b74dae6b2
In addition implements --heap-prof-name, --heap-prof-dir and --heap-prof-interval. These flags are similar to --cpu-prof flags but they are meant for the V8 sampling heap profiler instead of the CPU profiler. PR-URL: https://github.com/nodejs/node/pull/27596 Fixes: https://github.com/nodejs/node/issues/27421 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
18 lines
383 B
JavaScript
18 lines
383 B
JavaScript
'use strict';
|
|
|
|
const util = require('util');
|
|
const total = parseInt(process.env.TEST_ALLOCATION) || 100;
|
|
let count = 0;
|
|
let string = '';
|
|
function runAllocation() {
|
|
string += util.inspect(process.env);
|
|
if (count++ < total) {
|
|
setTimeout(runAllocation, 1);
|
|
} else {
|
|
console.log(string.length);
|
|
process.kill(process.pid, "SIGINT");
|
|
}
|
|
}
|
|
|
|
setTimeout(runAllocation, 1);
|