-
Notifications
You must be signed in to change notification settings - Fork 1k
feat_: implement onLowMemory and onTrimMemory for android #22540
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
base: develop
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (16)
|
Tried running this PR build on
checked go logs, it seems to avoid android OS thinking Status as |
in case of notification enabled, no killing after 5+ hours, switch Status back to foreground normally |
@qfrank |
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.
Thank you @qfrank for your awesome work. PR looks good to me
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.
Nice work @qfrank! Just a quick note, GC tweaks can also impact CPU. Have you checked if there's any spike in CPU usage caused by the forced GC?
There are some minor comments in the status-go PR, but LGTM overall 🚀
100% of end-end tests have passed
Not executed tests (2)Passed tests (22)Click to expandClass TestGroupChatMultipleDeviceMergedNewUI:
Class TestWalletOneDeviceTwo:
Class TestWalletMultipleDevice:
Class TestCommunityOneDeviceMerged:
Class TestCommunityMultipleDeviceMerged:
Class TestWalletCollectibles:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestProfileMultipleDevices:
Class TestWalletOneDevice:
|
09625ff
to
0115348
Compare
put Status into background, cpu usage is around 6%, after |
Hi @qfrank ! Thanks for your PR. |
…sPackage * Add methods to handle low memory events in MainApplication * Emit device events for low memory and trim memory notifications * Introduce switchToLowMemoryMode in StatusPackage to manage backend requests
* Implement logging of the last five historical process exit reasons on devices running Android R and above. * Handle cases where no exit reasons are found and log relevant details for each exit reason, including process name, reason, timestamp, and memory usage.
3c94a83
to
b9ab48b
Compare
Done :) @mariia-skrypnyk |
88% of end-end tests have passed
Failed tests (8)Click to expandClass TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestWalletConnectSignTransactions:
Class TestWalletConnectLoggedOut:
Class TestCommunityMultipleDeviceMerged:
Class TestWalletCollectibles:
Expected to fail tests (3)Click to expandClass TestWalletConnectSignTransactions:
Class TestCommunityMultipleDeviceMergedThree:
Class TestCommunityMultipleDeviceMerged:
Passed tests (77)Click to expandClass TestWalletOneDeviceTwo:
Class TestWalletOneDeviceThree:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestActivityMultipleDevicePR:
Class TestWalletConnectSignTransactions:
Class TestFallbackMultipleDevice:
Class TestWalletOneDevice:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestAndroid12:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestWalletCustomParamOneDevice:
Class TestCommunityMultipleDeviceMerged:
Class TestAndroid13:
Class TestProfileOneDevice:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestWalletMultipleDevice:
Class TestCommunityOneDeviceMerged:
Class TestActivityMultipleDevicePRTwo:
Class TestWalletConnectDifferentNetworks:
Class TestWalletConnectBaseChecks:
Class TestCommunityMultipleDeviceMergedThree:
Class TestDeepLinksOneDevice:
Class TestProfileMultipleDevices:
Class TestWalletCollectibles:
|
Summary
this PR might help fixing issue #22463
when switch Status App in background,
onLowMemory
/onTrimMemory
might be invoked, we get a chance to release some memory back to OS and keep our App stay alive longer rather than being killed.this PR also added getHistoricalProcessExitReasons
relate status-go PR
logcat log that shows
getHistoricalProcessExitReasons
works:Testing notes
see if PR build would keep our App stay alive longer in the background, if you can make Android system to trigger
onLowMemory or onTrimMemory
without usingam
that would be great! I haven't be able to reproduce ): However, when Status is in the background, you can runadb shell am send-trim-memory 22304 COMPLETE
to triggeronLowMemory
/onTrimMemory
manually. 22304 should be replaced with actual pid of Status.Platforms
Steps to test
status: ready.