-
Notifications
You must be signed in to change notification settings - Fork 653
Description
The app store is beginning to grow large enough that even 4GB RAM devices can no longer run all apps simultaneously without exceeding memory. We have a generous 4GB swapfile on Umbrel OS so this isn't causing crashes, but it will cause heavily degraded performance.
We should add some sort of RAM weighting to each app in the app manifest. This should be a rough estimate of how much memory an app uses during idle +~10% for some headroom. The total RAM weight for all installed apps should not exceed the total available RAM on the system. If a user tries to install an app that will push them over the limit they'll receive an error stating their device does not have enough RAM to install this app and they'll need to uninstall other apps to make room.
The RAM weight just needs to be a rough estimate of idle usage to prevent devices running loads of apps and processes being killed or everything being pushed into swap. It doesn't need to be accurate, and it doesn't matter if they regularly exceed those limits. e.g if an app exceeds the limit when being actively used but not at idle, that's fine. Normally only a small amount of apps are bring actively used at a time so if one or two are over the threshold everything should still be within RAM.
The RAM weighting is a temporary solution that allows us to quickly prevent users running into memory issues. Long term we should have a more sophisticated solution by monitoring the memory usage of individual apps and prompting the user to upgrade RAM or uninstall the problematic app if they are frequently running out of memory (ideally before that point).