Skip to content

Commit 2e086b3

Browse files
Sujay JayakarConvex, Inc.
authored andcommitted
Tell V8 it can use up to 2MiB of stack space (#24545)
GitOrigin-RevId: c9c5f3522d1e1208984aa2a9a8813a5cb0fb2675
1 parent 4ec64b4 commit 2e086b3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/isolate/src/client.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,10 @@ pub fn initialize_v8() {
566566
"--no-wasm-async-compilation".to_string(),
567567
// Disable `eval` or `new Function()`.
568568
"--disallow-code-generation-from-strings".to_string(),
569+
// We ensure 4MiB of stack space on all of our threads, so
570+
// tell V8 it can use up to 2MiB of stack space itself. The
571+
// default is 1MiB. Note that the flag is in KiB (https://github.com/v8/v8/blob/master/src/flags/flag-definitions.h#L1594).
572+
"--stack-size=2048".to_string(),
569573
];
570574
// v8 returns the args that were misunderstood
571575
let misunderstood = V8::set_flags_from_command_line(argv);

0 commit comments

Comments
 (0)