Adding 16 KB page size to Android

A page is the granularity at which an operating system manages memory. Most CPUs today support a 4 KB page size and so the Android OS and applications have historically been built and optimized to run with a 4 KB page size. ARM CPUs support the larger 16 KB page size. When Android uses this larger page size, we observe an overall performance boost of 5-10% while using ~9% additional memory.

In order to improve the operating system performance overall and to give device manufacturers an option to make this trade-off, Android 15 can run with 4 KB or 16 KB page sizes.

↫ Steven Moreland

Android 15 has been reworked to be page-size agnostic, meaning that a single binary can run on either 4 KB or 16 KB versions of Android. Any assumptions about page size have been removed from Android as well, the EROFS and F2FS file systems as well as UFS are now compatible with 16 KB, and a whole lot more things have been changed and refactored to make this transition as effortless as possible.

Application developers do need to do a few things, though. They’ll need to recompile their binaries with 16 KB alignment, after which they’ll need to be tested in a 16 KB version of an Android device or emulator. To make this possible, starting with Android 15 QPR1, the Pixel 8 and Pixel 8 Pro will get a new develop option that will reboot the device in 16 KB mode. In addition, Android Studio will gain a 16 KB emulator target as well. The 16 KB page size is an ARM-only feature, so people running the emulator on x86 devices will emulate the 16 KB page size, in which “the Kernel runs in 4 KB mode, but all addresses exposed to applications are aligned to 16 KB”.

Of course, Google urges Android developers to test for 16 KB page sizes as soon as possible.

18 Comments

  1. 2024-08-24 10:16 pm
    • 2024-08-24 11:52 pm
      • 2024-08-25 12:29 am
        • 2024-08-25 2:01 am
          • 2024-08-25 3:37 am
          • 2024-08-25 4:17 am
          • 2024-08-25 8:51 pm
          • 2024-08-26 2:02 am
          • 2024-08-26 2:23 am
          • 2024-08-26 11:40 pm
          • 2024-08-27 2:19 am
          • 2024-08-27 12:47 pm
          • 2024-08-27 2:49 pm
          • 2024-08-27 5:13 pm
          • 2024-08-27 7:08 pm
  2. 2024-08-24 10:18 pm
    • 2024-08-25 12:08 am
    • 2024-08-26 5:06 am