:orphan: .. title:: choice: Supported heap sizes .. _choice_412: .. describe:: choice: Supported heap sizes *Supported heap sizes* Type: ``bool`` Help ==== .. code-block:: none Heaps using reduced-size chunk headers can accommodate so called "small" heaps with a total size of 262136 bytes or less. Heaps using full-size chunk headers can have a total size up to 16383 megabytes. The overhead is of course bigger. On 32-bit system the tradeoff is selectable between: - "small" heaps with low memory and runtime overhead; - "big" heaps with bigger memory overhead even for small heaps; - "auto" providing optimal memory overhead in all cases but with a higher runtime overhead and somewhat bigger code footprint. On 64-bit systems the "big" chunk header size conveniently provides the needed alignment on returned memory allocations. Small chunk headers would require alignment padding up to the big header size anyway so "big" heap is the only option in that case. Direct dependencies =================== !\ :kconfig:`64BIT ` *(Includes any dependencies from ifs and menus.)* Defaults ======== - \ :kconfig:`SYS_HEAP_SMALL_ONLY ` if \ :kconfig:`SRAM_SIZE ` <= 256 - \ :kconfig:`SYS_HEAP_AUTO ` Choice options ============== - \ :kconfig:`SYS_HEAP_SMALL_ONLY ` - \ :kconfig:`SYS_HEAP_BIG_ONLY ` - \ :kconfig:`SYS_HEAP_AUTO ` Kconfig definition ================== At ``/os/Kconfig.heap:51`` Included via ``Kconfig:8`` → ``Kconfig.zephyr:43`` → ``/Kconfig:10`` → ``/os/Kconfig:88`` Menu path: (Top) → Additional libraries → OS Support Library → Heap and Memory Allocation .. code-block:: kconfig choice bool "Supported heap sizes" default SYS_HEAP_SMALL_ONLY if SRAM_SIZE <= 256 default SYS_HEAP_AUTO depends on !64BIT help Heaps using reduced-size chunk headers can accommodate so called "small" heaps with a total size of 262136 bytes or less. Heaps using full-size chunk headers can have a total size up to 16383 megabytes. The overhead is of course bigger. On 32-bit system the tradeoff is selectable between: - "small" heaps with low memory and runtime overhead; - "big" heaps with bigger memory overhead even for small heaps; - "auto" providing optimal memory overhead in all cases but with a higher runtime overhead and somewhat bigger code footprint. On 64-bit systems the "big" chunk header size conveniently provides the needed alignment on returned memory allocations. Small chunk headers would require alignment padding up to the big header size anyway so "big" heap is the only option in that case. *(The 'depends on' condition includes propagated dependencies from ifs and menus.)*