Skip to content

Commit

Permalink
Increase stack size to 3MB (#2508)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
frederikrothenberger authored Jun 17, 2024
1 parent 048b425 commit 0a1a9b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0a1a9b0

Please sign in to comment.