32 GB Canister Storage

Hey there,

Wondering about the 32 GB Storage in canister?

How to deploy a canister with 32 GB enabled ?

Thanks in Advance

Hey @gladguy,

you don’t need to enable anything. However, the 32 GB is not the normal WASM heap (still 4GB), but stable memory which needs to be accessed by the system API.

If you’re programming in Rust, there are some libraries that help work with stable memory. AFAIK there’s none for Motokot at the moment:

Update: There’s a WiP project for a StableBTree in Motoko: ICDevs.org - Bounty 24 - StableBtree Mokoko - up to $10k (cc @sardariuss)

1 Like

@claudio wrote a post on how you can make use of 32GiB of stable mem in motoko here Motoko stable memory in 2022 - #10 by claudio. But as @domwoe points out, you’ll probably want to use some motoko equivalent of the rust “stable structures” repo, so this is something that still needs work.

Currently being worked on by @sardariuss. See here:

Hey, just to clarify, do Motoko variables with the stable keyword get stored in stable memory or do you have to add them using the ExperimentalStableMemory API?

1 Like

Hey @tomijaga,

the stable annotation in Motoko only means that the variable is automatically serialized to stable memory during canister upgrades. But it still lives in the normal WASM heap in normal operation. Hence, you can’t make use of the stable memory increase currently, when only using the stable annotation.
See Stable variables and upgrade methods in the Documentation.

The ExperimenatalStableMemory API allows using the stable memory directly during normal operation of the canister.
See Stable Memory in the Documentation.

4 Likes