node/test/fixtures/workload/grow-worker-and-set-near-heap-limit.js
theanarkh e62f6ce630
v8: add setHeapSnapshotNearHeapLimit
PR-URL: https://github.com/nodejs/node/pull/44420
Refs: https://github.com/nodejs/node/pull/33010
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-09-08 09:33:20 +00:00

16 lines
396 B
JavaScript

'use strict';
const path = require('path');
const { Worker } = require('worker_threads');
const max_snapshots = parseInt(process.env.TEST_SNAPSHOTS) || 1;
new Worker(path.join(__dirname, 'grow-and-set-near-heap-limit.js'), {
env: {
...process.env,
limit: max_snapshots,
},
resourceLimits: {
maxOldGenerationSizeMb:
parseInt(process.env.TEST_OLD_SPACE_SIZE) || 20
}
});