Android 13 promises improved memory management, but not necessarily for everybody

No matter how much RAM manufacturers pour into their smartphones, we’ve all experiencedAndroid killing background apps a little too relentlessly. At best, it might mean relaunching your last-played song on Spotify, or reloading a tweet on Twitter, but in some cases, you might end up losing unsaved data. With an upcoming change toAndroid 13currently in testing, Google might finally be ready to improve how memory management works.

The folks atXDA Developersspotted anew commit on the Android Gerritthat follows through on some changes the company has been working towards on Chrome OS. Google is working to implement MGLRU, or “Multi-Generational Least Recently Used,” as a policy on Android. After initially rolling it out to millions of Chrome OS users, the company has merged it into Android 13’s kernel, potentially readying to expand its reach to countless smartphone owners.

4

This sort of memory management is a fairly complicated process — whether you’re looking at Android specifically or Linux as a whole. ThoughMishaal Rahmanat Esper.io offers a much more thorough look into what multi-generational LRU really brings to the table, here’s a super simplified explanation. Instead of having two lists of services (active and inactive), MGLRU uses “generations,” which allow for additional tiers than just the simple two-list approach. Once implemented, Android will look to clear pages from the oldest generation first, potentially making better choices about what should be killed silently in the background, resulting in improved performance overall.

According toarchived Linux entriesby a senior software engineer at Google from January, the company has already started testing this sort of memory management with about a million Android devices, though as XDA points out, those numbers likely point to Android Runtime on Chrome OS — not smartphones. Still, early results sound promising:

Samsung Notes logo in front of image containing S Pen and devices using Samsung Notes

Google’s fleetwide profiling shows an overall 40% decrease in kswapd CPU usage, in addition to improvements in other UX metrics, e.g., an 85% decrease in the number of low-memory kills at the 75th percentile and an 18% decrease in rendering latency at the 50th percentile.

Decreased kswapd (which manages virtual memory) usage should return improved CPU performance, which is great for any device from low-end models to flagships, but it’s the low-memory kill numbers that have us excited. It’s possible this change doesn’t arrive inAndroid 13, though it’s certainly being prepared for a future version of the OS. Asecond Gerrit commitpoints to the ability to enable MGLRU using ADB commands, so who knows — maybe we’ll get to try this out once the upcoming Android 13 beta program is live.

Google Home icon with some gadgets around it.

UPDATE: 2022/04/22 13:00 EST BY WILL SATTELBERG

More details

Esper.io’s Mishaal Rahmanhas published an in-depth exploration into exactly what MGLRU means for Android moving forward — including a super helpful explanation of how memory and page management works in full. It’s the perfect weekend read, but it also fills us in on some extra details concerning what these changes mean for Android moving forward.

A Pixel 9 Pro running Android 16 QPR1, showing notifications on the lock screen

First off, it sounds like the biggest impact MGLRU will have for smartphones will target low-end devices — gadgets without a ton of RAM that can struggle under intense workloads. Your next Galaxy S device will probably have plenty of overhead to keep managing apps and other background services without having to rely on these changes. That said, it’s notimpossiblefor flagship phones to see improvements from this — we’ll just have to wait and see what impact is truly made.

Second, you might have to pick up a new device to try it. While Rahman does suggest Google plans to try out MGLRU on the Pixel 6 series, you’ll likely need to pick up a phone that includes Android 13 pre-installed. This change in memory management requires an updated Linux kernel, and thanks to the Google Requirements Freeze program, many older phones won’t get it.

2021 phone pile

Navigate through galaxies of customization with Samsung’s One UI Home

It’s AI, but how it should be used

Expanded dark theme is here

Google now flags battery-hogging watch faces

Phone running out of juice too soon? Check your battery health

Generative AI, now poolside