This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Supported memory pool size on Thingy91

Hello,

I am working on a BLE application for the Thingy91 which needs a lot of dynamic memory.
In the Zephyr specification values of up to 16kB are supported. I tried to increase the pool
size to 32kB and this seems to work fine.

Hence my question: is it save to rely on this? Does the Thingy91 support larger memory pools?
Thank you in advance.

Kind regards

Nils

Parents
  • Hi.

    According to one of our developers, you can safely disregard the limits stated in the documentation.

    But, there are some details regarding Zephyr's current heap allocation algorithm that is worth noting:

    "Heap looks for chunk by dividing the big block into 4 subblocks. it goes down until it matches with the min block size from the configuration. In our case for example we have heap 512 minblock 32. Now we could increase heap to 1024 but that means the smallest chunk would be 64 bytes. It cannot divide yt as 64/4 is 16 and smaller then 32. So in the end we can allocate the same amount of chunks"

    This means that "a 32k heap would double the size available, but not increase the number of possible minimal blocks, whereas 64k would quadruple both space and possible minimal blocks".

    Best regards,

    Didrik

Reply
  • Hi.

    According to one of our developers, you can safely disregard the limits stated in the documentation.

    But, there are some details regarding Zephyr's current heap allocation algorithm that is worth noting:

    "Heap looks for chunk by dividing the big block into 4 subblocks. it goes down until it matches with the min block size from the configuration. In our case for example we have heap 512 minblock 32. Now we could increase heap to 1024 but that means the smallest chunk would be 64 bytes. It cannot divide yt as 64/4 is 16 and smaller then 32. So in the end we can allocate the same amount of chunks"

    This means that "a 32k heap would double the size available, but not increase the number of possible minimal blocks, whereas 64k would quadruple both space and possible minimal blocks".

    Best regards,

    Didrik

Children
Related