Next: , Previous: , Up: Top   [Contents][Index]


10 Stack and heap size

On emu stack and heap are just normal host OS stack and heap. Stack is typically 8 MiB although it’s OS-dependent.

On i386-pc, i386-coreboot, i386-qemu and i386-multiboot the stack is 60KiB. All available space between 1MiB and 4GiB marks is part of heap.

On *-xen stack is 4MiB. If compiled for x86-64 with GCC 4.4 or later addressable space is unlimited. When compiled for x86-64 with older GCC version addressable space is limited to 2GiB. When compiling for i386 addressable space is limited to 4GiB. All addressable pages except the ones for stack, GRUB binary, special pages and page table are in the heap.

On *-efi GRUB uses same stack as EFI. If compiled for x86-64 with GCC 4.4 or later addressable space is unlimited. When compiled for x86-64 with older GCC version addressable space is limited to 2GiB. For all other platforms addressable space is limited to 4GiB. GRUB allocates pages from EFI for its heap, at most 1.6 GiB.

On i386-ieee1275 and powerpc-ieee1275 GRUB uses same stack as IEEE1275.

On i386-ieee1275 and powerpc-ieee1275, GRUB will allocate 32MiB for its heap on startup. It may allocate more at runtime, as long as at least 128MiB remain free in OpenFirmware.

On sparc64-ieee1275 stack is 256KiB and heap is 2MiB.

On mips(el)-qemu_mips and mipsel-loongson stack is 2MiB (everything below GRUB image) and everything above GRUB image (from 2MiB + kernel size) until 256MiB is part of heap.

On mips-arc stack is 2MiB (everything below GRUB image) and everything above GRUB image(from 2MiB + kernel size) until 128MiB is part of heap.

On mipsel-arc stack is 2MiB (everything below GRUB image which is not part of ARC) and everything above GRUB image (from 7MiB + kernel size) until 256MiB is part of heap.

On arm-uboot stack is 256KiB and heap is 2MiB.

In short:

PlatformStackHeap
emu8 MiB?
i386-pc60 KiB< 4 GiB
i386-coreboot60 KiB< 4 GiB
i386-multiboot60 KiB< 4 GiB
i386-qemu60 KiB< 4 GiB
*-efi?< 1.6 GiB
i386-ieee1275?< 32 MiB
powerpc-ieee1275?available memory - 128MiB
sparc64-ieee1275256KiB2 MiB
arm-uboot256KiB2 MiB
mips(el)-qemu_mips2MiB253 MiB
mipsel-loongson2MiB253 MiB
mips-arc2MiB125 MiB
mipsel-arc2MiB248 MiB
x86_64-xen (GCC >= 4.4)4MiBunlimited
x86_64-xen (GCC < 4.4)4MiB< 2GiB
i386-xen4MiB< 4GiB

Next: , Previous: , Up: Top   [Contents][Index]