# Does freeing memory decrease canister memory usage?

**URL:** <https://forum.dfinity.org/t/does-freeing-memory-decrease-canister-memory-usage/34237>\
**Category:** Developers\
**Created:** [August 17, 2024, 8:43am UTC](https://forum.dfinity.org/t/does-freeing-memory-decrease-canister-memory-usage/34237 "2024-08-17T08:43:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [August 17, 2024, 8:43am UTC](https://forum.dfinity.org/t/does-freeing-memory-decrease-canister-memory-usage/34237/1 "2024-08-17T08:43:12Z")

</div>

Does freeing memory (as per Motoko or Rust) decrease canister memory usage (and thus lead to decreased storage costs)?

---

<div class="post-metadata">

**Author:** ![berestovskyy](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/berestovskyy/32/3989_2.png) [@berestovskyy](https://forum.dfinity.org/u/berestovskyy)\
**Post date:** [August 17, 2024, 4:50pm UTC](https://forum.dfinity.org/t/does-freeing-memory-decrease-canister-memory-usage/34237/2 "2024-08-17T16:50:15Z")

</div>

Unfortunately not. Wasm memory can only be increased, not decreased (see [Wasm specification](https://www.w3.org/TR/wasm-core-2/#memory-instructions%E2%91%A0)).

Practically speaking, the only way to reduce memory usage is to reinstall the canister. This will completely remove the old heap memory during the reinstallation process.
