Enable 16KB page size

Android 15 (AOSP experimental) and higher have support for building Android with a 16KB page size. This option uses additional memory but improves system performance.

16KB pages is only supported on arm64 targets with 16KB kernels.

To enable 16KB pages, set the following build options on a device:

  • PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO := true removes the PAGE_SIZE define, and it makes components determine page size at runtime.
  • PRODUCT_MAX_PAGE_SIZE_SUPPORTED := 65536 which ensures platform ELF files are built with 64K alignment. This larger-than-needed size is for future compatibility. With 64K ELF alignment, the kernel can support 4KB/16KB/64KB page sizes.