Skip to content

Commit a035c85

Browse files
goffrieConvex, Inc.
authored andcommitted
Double heap limit raised by near_heap_limit_callback (#37174)
GitOrigin-RevId: a8cf357525d8ad51c3361ebaaf65f5f4d2879e43
1 parent 3cbe79c commit a035c85

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/isolate/src/isolate.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ extern "C" fn near_heap_limit_callback(
381381
let heap_ctx = unsafe { &mut *(data as *mut HeapContext) };
382382
heap_ctx.handle.terminate(TerminationReason::OutOfMemory);
383383

384-
// Double heap limit to avoid a hard OOM.
385-
current_heap_limit * 2
384+
// Raise the heap limit a lot to avoid a hard OOM.
385+
// This is unfortunate but there is some C++ code in V8 that will abort the
386+
// process if it fails to allocate. We're about to terminate the isolate
387+
// anyway so any allocation will be very short-lived.
388+
current_heap_limit * 4
386389
}

0 commit comments

Comments
 (0)