-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Enable 16KB memory page size on Android #64640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable 16KB memory page size on Android #64640
Conversation
Adds the ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES argument to the CMake configuration in the Gradle build file to support flexible page sizes in native builds.
MariaHCD
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense - tagging @roryabraham for additional 👀
roryabraham
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrispader please fill out test and QA steps on this PR and complete the author checklist
Just checking if the HybridApp build also works fine! Will finish the PR Author Checklist after that |
|
@roryabraham to enable 16KB mode, we'll have to update or add minor patches for all the libraries that are not 16kb enabled. The patch includes just one change |
|
|
|
@chrispader adding patches is fine, so long as we:
|
…packaging-for-16kb-memory-page-size.patch
…aging-for-16kb-memory-page-size.patch
…ry-page-size.patch
package.json
Outdated
| "react-native-url-polyfill": "^2.0.0", | ||
| "react-native-view-shot": "4.0.0", | ||
| "react-native-vision-camera": "^4.6.1", | ||
| "react-native-vision-camera": "^4.7.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with vision-camera?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR up here: #66640
|
Ok so i've patched more libraries and updated Android native Gradle libraries to versions that are compatible with Android 16KB memory page size. After building the HybridApp, i ran the script for checking library alignment and this is the current output. ./scripts/check-android-16kb-memory-page-size-compatibility.sh Mobile-Expensify/Android/build/outputs/apk/debug/Expensify-debug.apk`
Recursively analyzing Mobile-Expensify/Android/build/outputs/apk/debug/Expensify-debug.apk
NOTICE: Zip alignment check requires build-tools version 35.0.0-rc3 or higher.
You can install the latest build-tools by running the below command
and updating your $PATH:
sdkmanager "build-tools;35.0.0-rc3"
=== ELF alignment ===
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libpartition_alloc.cr.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libreact_codegen_safeareacontext.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libpdfium.cr.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libgifimage.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libjsi.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libExpensifyNitroUtils.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libreact_codegen_rnscreens.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libnative-filters.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libchrome_zlib.cr.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libVisionCamera.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libpdfiumandroid.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libfbjni.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libmapbox-common.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libworklets.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/librnscreens.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libcrashlytics-common.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libhermestooling.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libreact_codegen_rnpicker.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libmapbox-maps.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libnative-imagetranscoder.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libjsc.so: \e[32mALIGNED\e[0m (2**16)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libpl_droidsonroids_gif.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libreact_codegen_RNLiveMarkdownSpec.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/liblivemarkdown.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libimagepipeline.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libappmodules.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libicuuc.cr.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libcrashlytics.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libgesturehandler.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libexpo-av.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libjsc-android.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libNitroModules.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libNativeBridge.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libhermes.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libc++_shared.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libtensorflowlite_jni.so: \e[32mALIGNED\e[0m (2**16)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libcrashlytics-handler.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libRNNitroSQLite.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libanimation-decoder-gif.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libreanimated.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libfs-native.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libexpo-modules-core.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libreactnative.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libreact_codegen_rnsvg.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libjsctooling.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libabsl.cr.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libavif_android.so: \e[31mUNALIGNED\e[0m (2**12)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libimage_processing_util_jni.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libdatastore_shared_counter.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/librealm-jni.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libcrashlytics-trampoline.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/b1/xj_1nb1j5w9gx10ntjfr6jc40000gn/T/Expensify-debug_out_XXXXX.42xhEgxPqh/lib/arm64-v8a/libc++_chrome.cr.so: \e[31mUNALIGNED\e[0m (2**12)
\e[31mFound 14 unaligned libs (only arm64-v8a/x86_64 libs need to be aligned)All the lines that show |
|
Next steps are:
android {
defaultConfig {
externalNativeBuild {
cmake {
arguments "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
}
}
}
}
|
|
Closing this as a dupe of #69161 |
@roryabraham
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/13604
Explanation of Change
There was a blog post by the Android team recently which announces that Android apps will need to support 16KB memory page sizes by November 1st, 2025. Enabling 16KB memory page sizes brings significant performance improvements, e.g. faster app launches, battery usage, camera starts, ...
This PR enables 16KB memory page size, to unlock performance gains and to be prepared early for the deadline of November 1st, 2025.
Separate PRs for library updates:
react-native-vision-cameraExpensify internal libraries:
@expensify/react-native-live-markdownreact-native-onyxUpstream Issues/PRs:
@react-native-firebase/crashlyticsFixed Issues
$ #63871
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop