Support 16 KB page sizes
- Google Play compatibility requirement
- Benefits and performance gains
- Check if your app is impacted
- Does your app use native code?
- Identify native libraries using APK Analyzer
- Detect alignment issues with automated checks
- Check the alignment of ELF segments for shared libraries
- Use APK Analyzer (Recommended)
- Use the check_elf_alignment.sh script (Linux or macOS)
- Use command-line tools directly
- Check the RELRO security flag
- Use APK Analyzer (Recommended)
- Use command-line tools
- Step 1: Inspect the program headers
- Linux or macOS
- Windows (PowerShell)
- Step 2: Verify 16 KB compliance for RELRO
- Examples
- Example 1: Non-aligned .so file (Non-compliant)
- Example 2: Aligned .so file with a RELRO segment (Compliant)
- Example 3: .so file without a RELRO segment (Compliant)
- Example 4: GNU_RELRO in its own LOAD segment (Compliant)
- Build your app with support for 16 KB devices
- Update the packaging of your shared libraries
- Use bundletool to verify zip alignment
- AGP version 8.5.1 or higher
- AGP version 8.5 or lower
- Groovy
- Kotlin
- AGP version 8.0 or lower
- Compile your app using 16 KB ELF alignment
- Android NDK r28 and higher
- Android NDK r27 and lower
- ndk-build
- CMake
- Fix code and resolve runtime issues
- Optimize custom memory allocators
- 1. Avoid hard-coded byte thresholds for freeing memory
- 2. Fill up already-used pages first (dense-first allocation)
- 3. Align memory pools to 16 KB and keep pool sizes moderate
- 4. Release physical memory for cached large buffers immediately
- 5. Zero out memory on free instead of on allocation for ZRAM compression
- Summary of recommendations
- Check SDKs for 16 KB support
- Test your app in a 16 KB environment
- Set up the Android Emulator with a 16-KB-based system image
- Launch the emulator
- Enable 16 KB mode on a device using developer options
- 16 KB backcompat mode
- Additional resources