node/test/fixtures/workload/allocation-sigint.js
Joyee Cheung 4b74dae6b2
inspector: implement --heap-prof
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>
2019-05-26 22:18:00 +02:00

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);