# IC Stable Structures - default page allocation

**URL:** <https://forum.dfinity.org/t/ic-stable-structures-default-page-allocation/33880>\
**Category:** Developers\
**Tags:** rust\
**Created:** [August 5, 2024, 11:01am UTC](https://forum.dfinity.org/t/ic-stable-structures-default-page-allocation/33880 "2024-08-05T11:01:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![frederico02](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@frederico02](https://forum.dfinity.org/u/frederico02)\
**Post date:** [August 5, 2024, 11:01am UTC](https://forum.dfinity.org/t/ic-stable-structures-default-page-allocation/33880/1 "2024-08-05T11:01:18Z")

</div>

Hi,

I’m creating a scalable archive solution. As part of the solution, I regularly check the stable memory size of an archive canister. It works fine. However, in testing with PocketIC ( rust ), I notice that my archive canister spins up with around 129 pages of stable memory. This means I have to insert a lot of data to my archive and set a threshold of 8MB for when a new archive canister should be created. Based on previous discussions i’ve had around ic-stable-structures I know that 8MB is allocated by default right?

Is there a way I can limit or set the amount of memory allocated for the StableBTreeMap when it is initialized?

Thanks,

Freddie

---

<div class="post-metadata">

**Author:** ![frederico02](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@frederico02](https://forum.dfinity.org/u/frederico02)\
**Post date:** [August 5, 2024, 12:11pm UTC](https://forum.dfinity.org/t/ic-stable-structures-default-page-allocation/33880/2 "2024-08-05T12:11:19Z")

</div>

Ignore,

I forced the bound in my storable type to be artificially high for testing.

```rust

impl Storable for MyType {
    fn to_bytes(&self) -> Cow<[u8]> {
        Cow::Owned(Encode!(self).unwrap())
    }
    fn from_bytes(bytes: Cow<[u8]>) -> Self {
        Decode!(&bytes, Self).unwrap()
    }
    const BOUND: Bound = Bound::Bounded {
        max_size: 100_000,
        is_fixed_size: false,
    };
}

```

the higher i make max\_size, the faster the page fills up. this means i have to insert a lot less data to fill up the pre-allocated memory that ic-stable-structures initializes
