0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/fixtures/workload/allocation-exit.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
364 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.exit(55);
}
}
setTimeout(runAllocation, 1);