Compare commits

...

2 Commits

Author SHA1 Message Date
Jarred Sumner
4ac10bea14 Update spawn-pipe-leak.test.ts 2025-05-31 02:30:39 -07:00
Jarred Sumner
a77571e349 Run mi_collect after releasing heap access 2025-05-31 02:25:23 -07:00
2 changed files with 3 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
#include <JavaScriptCore/VM.h>
#include <JavaScriptCore/Heap.h>
#include <mimalloc.h>
// It would be nicer to construct a DropAllLocks in us_loop_run_bun_tick (the only function that
// uses onBeforeWait and onAfterWait), but that code is in C. We use an optional as that lets us
@@ -20,6 +21,7 @@ extern "C" void Bun__JSC_onBeforeWait(JSC::VM* vm)
drop_all_locks.emplace(*vm);
if (previouslyHadAccess) {
vm->heap.releaseAccess();
mi_collect(false);
}
}
}

View File

@@ -75,5 +75,5 @@ describe("Bun.spawn", () => {
const pct = delta / memBefore.rss;
console.log(`RSS delta: ${delta / MB}MB (${Math.round(100 * pct)}%)`);
expect(pct).toBeLessThan(0.5);
}, 10_000); // NOTE: this test doesn't actually take this long, but keeping the limit high will help avoid flakyness
}, 30_000); // NOTE: this test doesn't actually take this long, but keeping the limit high will help avoid flakyness
});