The team at the Android Open Source Project is working on a feature called ‘hibernation’, which will reduce the memory footprint of apps you are not using. This feature is still in the early stages of development but may be included in Android 12. There is no official release date of Android 12, but the Developer Preview of Android 11 came out in February 2020, so we can expect something soon.
What’s hibernation, you ask? If a single user of a multi-user device chooses to hibernate an app, the app cache associated with that user will be cleared, freeing up a bit of space. That is already implemented. The more interesting question though is what happens when all users of the Android device hibernate an app, especially since most devices have only one user set up? Since it’s not implemented yet, it is not clear what the OS will do if this happens.
From the name of the feature, it sounds like the app will not be permanently uninstalled, but there may be a way to compress it to save space. Later, it could be uncompressed if the user wants to wake the app from hibernation. It is worth remembering though, that this hibernation feature is completely unrelated to the hibernation function offered by some apps that pause app execution, similar to Android’s built-in-Doze state.