Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/parallel/test-worker-memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const numWorkers = +process.env.JOBS || require('os').cpus().length;
// Verify that a Worker's memory isn't kept in memory after the thread finishes.

function run(n, done) {
console.log(`run() called with n=${n} (numWorkers=${numWorkers})`);
if (n <= 0)
return done();
const worker = new Worker(
Expand All @@ -27,6 +28,7 @@ const startStats = process.memoryUsage();
let finished = 0;
for (let i = 0; i < numWorkers; ++i) {
run(60 / numWorkers, () => {
console.log(`done() called (finished=${finished})`);
if (++finished === numWorkers) {
const finishStats = process.memoryUsage();
// A typical value for this ratio would be ~1.15.
Expand Down