From 0a1a9b0eb4ec061faa84f59fdd5455081013b669 Mon Sep 17 00:00:00 2001 From: Frederik Rothenberger Date: Mon, 17 Jun 2024 15:13:18 +0200 Subject: [PATCH] Increase stack size to 3MB (#2508) This PR increases the stack size from the 1MB default to 3MB as per recommendation [here](https://dfinity.slack.com/archives/CH4CADCJX/p1717748706241909?thread_ts=1716464873.584739&cid=CH4CADCJX). I did some tests with very small stack sizes to see when we hit errors to get a feeling for the current stack usage of II. The tests indicate that we currently use more than 48KB but fewer than 200KB of stack. Since we are also very lean on heap usage (~6.5 MB currently) we can afford to increase the stack size to have more leeway with regards to the stack. --- scripts/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build b/scripts/build index 0a801235f4..1183ca2431 100755 --- a/scripts/build +++ b/scripts/build @@ -120,7 +120,7 @@ function build_canister() { TARGET="wasm32-unknown-unknown" # standardize source references CARGO_HOME="${CARGO_HOME:-"$HOME/.cargo"}" - RUSTFLAGS="--remap-path-prefix $CARGO_HOME=/cargo" + RUSTFLAGS="--remap-path-prefix $CARGO_HOME=/cargo -C link-args=-zstack-size=3000000" cargo_build_args=( --manifest-path "$SRC_DIR/Cargo.toml"