Skip to content
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

Can PRoot be used to help work around the Phantom Process Kill introduced in Android 12 #260

Open
corbinlc opened this issue Mar 10, 2023 · 1 comment

Comments

@corbinlc
Copy link
Contributor

Problem description
In Android 12, a phantom process killer started killing background processes if more than 32 total were in use.
This has been discussed in quite a few places. Here is one example that also provides some known workarounds. https://github.com/agnostic-apollo/Android-Docs/blob/master/en/docs/apps/processes/phantom-cached-and-empty-processes.md

Steps to reproduce
That same write up describes how to trigger the phantom process killer in Termux.
https://github.com/agnostic-apollo/Android-Docs/blob/master/en/docs/apps/processes/phantom-cached-and-empty-processes.md#how-to-manually-trigger-phantom-process-killing-in-termux
Running something complicated like a full DE will also trigger this (please note, the killer might not kill the process for a few seconds or minutes after the threshold is crossed)

Expected behavior
Obviously we don't want our processes killed.

Additional information
My curiosity is have you thought about using proot as a way to workaround this? The trick might involve making child processes look like an extension of the parent as opposed to a separate process. If possible, this would artificially reduce the number of seen child processes. This is something I am noodling on right now, but I am wondering what others think.

@corbinlc
Copy link
Contributor Author

corbinlc commented Mar 11, 2023

My initial thoughts are to play around with some of the flags with clone() but I am going to research a bit how Android keeps track of which processes are background processes compared to app processes. Possibilities would be like CLONE_PARENT or CLONE_THREAD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant