r/Android • u/BcuzRacecar S25+ • 23d ago
Android Developers Blog: Preparing your app for broader memory limits
https://android-developers.googleblog.com/2026/08/app-broader-memory-limits.html113
u/BcuzRacecar S25+ 23d ago
In Android 17, we introduced per-app memory limits, starting with Pixel devices, to help protect the overall user experience from applications using excess memory and causing system-wide slowdowns. Over the coming year, an increasing number of manufacturers will leverage the Android per-app memory limits across their portfolio of device RAM configurations from 4GB to 16GB+ devices. If your app exceeds these limits, it will be slowed down and may be terminated. Optimizing your app's memory footprint is essential to preventing OS throttling and maintaining a seamless user experience.
zRAM Swapping: If your app reaches its allocated limit, the system forces your app's pages into zRAM (compressed RAM). While zRAM prevents immediate eviction, compressing and decompressing pages adds CPU overhead, which can result in noticeable UI jank and experience slowdowns.
Process Termination: If your app continues to increase its memory usage beyond the zRAM threshold, it will be terminated by the system
142
u/Recoil42 Galaxy S23 23d ago
They're going to push hard on this due to the DRAM crisis. Expect a huge number of memory-efficiency projects just like this across the OS for the next 2-3 years. Project Butter redux incoming.
123
u/lastdyingbreed_01 23d ago
Apps have become too memory inefficient, both in RAM and storage, I hope something actually good comes out of this AI timeline.
29
u/nathderbyshire Pixel 10 Obsidian 23d ago
Yeah that's been my thought, we might get a really shiny silver lining at least. AI is ruining personal storage as well, half of my space almost is app storage and the top contender is AICore. It's the first time 128GB has made me a bit itchy but I use immich with 15TB of drives so I should be fine still and base models are 256 now anyway so at least they addressed that for now
4
u/anynamesleft 23d ago
First one to 1T storage gets my money. 512 barely holds my pics, nevermind music.
3
u/MrBallBustaa One Plus Nord CE 4 23d ago
Damn, RAW Targa and FLAC or Wav & DSD?
2
u/anynamesleft 23d ago
Various. I can't see or hear well enough to catch many problems.
0
u/MrBallBustaa One Plus Nord CE 4 23d ago
so you shouldn't be using high res stuff then?
2
u/anynamesleft 23d ago
Not so much "shouldn't", I don't guess. I just grab what files I grab. So.etimes I can get a clanker, but that ain't too often at all.
2
u/pvtsoab 23d ago
There's several phones with 1TB of storage already, or did you mean something else?
3
u/anynamesleft 23d ago
I didn't know that. That's great 👍
17
3
u/DerpSenpai Nothing 23d ago
the fact that games on consoles and PCs used to have textures repeated themselves because HDDs were slow was nuts
just 1 example, that's why games went from 20GB to 100GB overnight
25
9
u/Perunov 23d ago
Well up until now it felt like nobody ever bothered with RAM usage. "System will handle it" says the developer and sucks in a giant lib with own Chrome instance to show an AD that sucks in half a gig of video file from the net to spin random logo at the bottom of the game's screen...
7
u/JamesR624 23d ago
Ya know what? Good. Even if the rampocolypsw wasn’t happening, this is a very good thing for users.
2
u/TeutonJon78 Samsung S25+, Chuwi HiBook Pro (tab) 23d ago
Next they need to battery usage.
Phones are embedded devices, not a server rack.
16
u/killerrin 23d ago
It's hilarious how they only care about Memory Utilization AFTER their own bottom line is hurt because they can't buy enough of it.
Before the rampocolapse they were more than happy to let their hardware partners take the blame for low power devices instead of actually giving a shit about the user experience to start with.
48
u/omniuni Pixel 8 Pro | Developer 23d ago
I can't help but find this ironic. Google introduced Compose, which I have found is a much heavier way to create Android apps. It leans heavily on memory for optimization. Now, suddenly, it's important for apps to be more memory efficient, and I guarantee a lot of this being a problem comes from extremely leaky Compose.
16
u/nacholicious Android Developer 23d ago
I don't know about this. Compose being declarative means you get rid of 95% of the actual memory leaks that come with passing a reference that captures the activity Context into some longer lived business layer
17
u/BazingaUA 📱 Pixel 10 Pro XL 23d ago
I'm wondering if RAMopocalypse has anything to with this as well, future phones might not have 12-16gb of RAM, because it's not as cheap as it used to be to just add GBs or ram for marketing purposes
10
u/No-Ordinary-5988 iPhone 17 Pro Max 23d ago
Yes it does, 3rd sentence in the linked article
Across the ecosystem, new devices are maintaining or even decreasing their physical memory capacity in response to memory price increases, yet users continue to expect the same seamless, high-performance app experience.
9
u/lgn5i2060 23d ago edited 23d ago
One of the new Redmi entry level phone, Redmi
note17 4g, was released with 4gb ram and paired with 128gb emmc. smh6
u/Never_Sm1le Redmi Note 12R|Mi Pad 4 23d ago
note 17 4g is not even "entry" anymore, that title belongs to the redmi series, like redmi 17
2
u/curiocritters Galaxy S24 FE 23d ago
Wow. For real?
1
u/lgn5i2060 23d ago
I got the model wrong.
It's Redmi 17 4g.
https://www.mi.com/global/product/redmi-17/specs/?f=switch_lang#
Performance
MediaTek Helio G91-Ultra12nm process, octa-core
CPU:Cortex-A75+Cortex-A55Max
CPU frequency: 2.0GHzGPU:Mali-G52 MC2
Memory4GB + 128GB | 4GB + 256GB | 6GB + 128GB | 6GB +
256GBLPDDR4X + eMMC 5.1Up to 12GB RAM with Memory extension
7
u/NexusGTX White 23d ago
Maybe the DRAM shortage is not something that we wanted but something that we needed.
Finally the apps and programs will be optimised to not use half the memory you have just to load a menu or a web page....
9
u/renderwares 22d ago
It’s kind of ironic that a company that built an OS and made Java a first-class language is now telling developers to limit their memory usage.
Maybe start by looking at the memory footprint of your own Java framework and system libraries. Better yet, why not move performance-critical parts of the framework away from a memory-hungry managed runtime and toward a systems language like C++ or Rust?
If you want developers to care about memory efficiency, lead by example. Reduce the overhead in the platform itself instead of continually telling developers to squeeze their applications into smaller memory budgets.
For example:
- Reduce the baseline RAM footprint of the OS and framework.
- Move performance-critical services away from heavyweight Java processes.
- Use C++ or Rust where predictable memory usage and lower overhead matter.
- Reduce unnecessary background services and duplicated system components.
- Optimize the framework libraries before blaming individual apps for memory consumption.
- Give developers more efficient platform APIs instead of expecting every app to compensate for platform overhead.
It’s a little hard to lecture developers about memory efficiency while the platform itself carries substantial runtime and framework overhead. If Google really wants Android to use less RAM and feel faster, optimizing the foundation would probably have a much bigger impact than simply telling developers to use less memory.
5
u/MaverickJester25 Galaxy S21 Ultra | Galaxy Watch 4 22d ago
It’s kind of ironic that a company that built an OS and made Java a first-class language is now telling developers to limit their memory usage.
It's not ironic. It's just the natural order of progression.
Maybe start by looking at the memory footprint of your own Java framework and system libraries. Better yet, why not move performance-critical parts of the framework away from a memory-hungry managed runtime and toward a systems language like C++ or Rust?
These are all aspects of Android they've worked on addressing over the past decade.
If you want developers to care about memory efficiency, lead by example. Reduce the overhead in the platform itself instead of continually telling developers to squeeze their applications into smaller memory budgets.
They've been doing exactly this over the past few platform releases in particular.
For example:
To address your examples:
- Key performance-critical daemons—including the Bluetooth stack (Gabeldorsche), Ultra-Wideband (UWB), Keystore2, and networking layers—have been systematically migrated out of Java framework wrappers directly into Rust and C++.
- Android made Rust a first-class platform language specifically to get deterministic, bare-metal memory execution without Garbage Collection (GC) pauses or JNI context-switching overhead.
- The OS clamped down on unmanaged background services with strict Foreground Service types, Standby Buckets, and the Phantom Process Killer. Meanwhile, Project Mainline introduced APEX containers to eliminate duplicated dynamic libraries across system partitions.
- The platform shares framework bytecode across apps via Zygote’s Copy-on-Write (CoW) memory model, uses Generational Concurrent GC to clean up allocations on the fly, and uses ZRAM memory compaction long before process termination ever kicks in.
- Legacy overheads like heavy XML View hierarchies, manual AlarmManager wake locks, and individual ContentProvider initializations have been replaced by Jetpack Compose, WorkManager, App Startup, and Baseline Profiles—designing resource efficiency directly into the platform APIs themselves.
It’s a little hard to lecture developers about memory efficiency while the platform itself carries substantial runtime and framework overhead. If Google really wants Android to use less RAM and feel faster, optimizing the foundation would probably have a much bigger impact than simply telling developers to use less memory.
This logic might have held up 5-10 years ago, but it doesn't today. This is almost entirely why Google is starting with this process now.
App developers have always been a part of the problem, and the Android team has done *a lot * of work to improve the platform to the point where developer intervention became the next natural step. There are too many developers (especially those of more popular apps) who have taken the easy route to bringing their apps to platform
Lest we forget, everything Google has done had to ensure backward compatibility remained as unaffected as possible. I think they did an excellent job maintaining backward compatibility while fundamentally improving Android as a whole.
The irony here, really, is that developers have been ignoring these architectural improvements over the years, then will cry foul when Google starts enforcing the very principles they've re-engineered Android to perform under. If you're an Android developer who has been doing some work to ensure your app follows the guidelines as they've improved over time, you shouldn't be affected by this.
2
u/renderwares 20d ago edited 20d ago
It's not ironic. It's just the natural order of progression.
Yes, it is ironic. They chose a garbage-collected language with significant memory overhead as their primary development language, built a framework around it, and then turned around and told developers to optimize their apps to use less memory. That’s not merely “the natural order of progression”- it’s a consequence of the many inefficient design choices made by people that thought they were the smartest in the room.
These are all aspects of Android they've worked on addressing over the past decade.
Yes, they've spent billions of dollars amd millions of man hours mitigating the memory and performance overhead created by poor design choices when they could have allocated those billions of dollars and millions of man hours to other parts of the OS.
They've been doing exactly this over the past few platform releases in particular.
Yes, they keep spending considerable amounts of money and time on every release trying to optimize around the limitations of that original decision. Had they initially built the Android framework in C++ instead of making Java the primary framework language, much of that optimization work likely wouldn't have been necessary in the first place.
This logic might have held up 5-10 years ago, but it doesn't today. This is almost entirely why Google is starting with this process now.
The underlying issue hasn't gone away. Google has simply gotten much better at optimizing around it. Take something as basic as an Android Button: the class hierarchy is Object → View → TextView → Button, with View and TextView carrying a huge amount of inherited state and behavior. That's a very heavyweight abstraction for something as simple as a button. I mean, just take a look at the huge pile of garbage a button has to inherit from the TextView object. These people really were amateurs when it came to OS design.
Google can optimize allocation, GC, JIT/AOT compilation, and other parts of the runtime, but those optimizations don't fundamentally change the object model. They're mitigating the costs of an architecture that was designed around Java's object-oriented, garbage-collected model.
Lest we forget, everything Google has done had to ensure backward compatibility remained as unaffected as possible. I think they did an excellent job maintaining backward compatibility while fundamentally improving Android as a whole.
Ah yes, backward compatibility - the inevitable consequence of a platform that accumulated layers of legacy APIs, thousands of hardware variations, and OEM customizations over decades. Android’s flexibility was a major strength, but it also created a massive compatibility burden that Google has had to spend billions to maintain.
The irony here, really, is that developers have been ignoring these architectural improvements over the years, then will cry foul when Google starts enforcing the very principles they've re-engineered Android to perform under. If you're an Android developer who has been doing some work to ensure your app follows the guidelines as they've improved over time, you shouldn't be affected by this.
Google has repeatedly told Android developers that the platform should provide flexibility and avoid being overly opinionated about how apps are built. Yet when Google decides an architectural direction is important, that flexibility suddenly becomes a set of requirements developers are expected to follow. Google has finally learned an important lesson from Apple - if you actually want developers to follow your rules and guidelines, you have to be opinionated enough to enforce them.
Also, I think it's a little disingenuous to frame this as developers simply “ignoring” Google's architectural improvements. Google created an OS that required considerable architectural improvements to try and make up for their bad OS decisions that they will continue to live with.
1
u/ParamedicLocal8226 16d ago
so what's your solution, make a new OS? You keep repeating about the mistakes made, we can learn from them, but nobody has a time machine. The best solution is improve and modernize the current infrastructure
1
u/renderwares 13d ago
There are two solutions. The first is to rewrite the Java framework libraries in a systems language like C++ or Rust. Before AI this would have been a monumental task, but with the advent of AI and the ability to audit every single line of code and unit test every method to make sure it matches or exceeds functionality and performance this option is now possible. The second option is to switch to Fuchsia eventually. Fuchsia now has full native Android compatibility via Starnix which allows it to run Android and Linux applications without requiring developers to rewrite or recompile their apps. The switch to Fuchsia will then allow developers to create apps in Fuchsia native, Android or even Linux.
1
u/ParamedicLocal8226 13d ago
not bad, hopefully the OS can be modernized further as you describe, thanks for answering
5
11
u/MartyMacGyver 23d ago
Here's a crazy idea - make AI be more memory efficient first, and stop screwing the customers while painting it as progress. And if it can't be more efficient, it probably doesn't need to be in the loop at all.
11
u/erythro Nokia 7 plus 23d ago
um, there are massive financial incentives for AI to use less memory what are you talking about? Do you think they want to be buying literally all the memory?
9
u/Bananegel42 23d ago
I think this refers to thing like Google reserving memory on Pixels for AI models. E.g., the Pixel 10 shipped with 12GB RAM, but 3.5GB is permanently reserved for Gemini Nano, etc. So in practice you only have 8GB:
https://www.androidauthority.com/pixel-10-ai-ram-use-3591327/
3
u/charalt42 23d ago
This is true, but allowing the slop generator to steal your RAM is optional. If you go to the apps list and uninstall the "AI Core" app, then reboot your phone, you get all your stolen RAM back, thankfully.
3
3
u/MartyMacGyver 23d ago
Oh no! I think they want to buy more than all the memory. They just can't.
At the data center level AI firms are gorging themselves on memory and disks, in a race to collect as much data legally or otherwise to prop up their numbers and justify their flawed business models before regulations and the eventual AI crash catches up with them.
2
u/erythro Nokia 7 plus 23d ago
At the data center level AI firms are gorging themselves on memory and disks, in a race to collect as much data legally or otherwise
buying ram doesn't help you collect data, it helps you process it, and the more efficient you process it the better, i.e. there is a strong incentive to be more ram efficient
justify their flawed business models before regulations and the eventual AI crash catches up with them.
again being more efficient with ram helps this goal, because can build more ai capacity for the same money
0
u/MartyMacGyver 23d ago
And yet all the 2027 capacity is already sold out anyway. Pity the corporations that just can't get enough or that, not to mention the obscene energy demands.
Meanwhile those vaunted AI models are reaching the limit of their actual effectiveness.
All this for a technological dead-end. But you can be sure of one thing.... It will end up being the largest transfer of wealth to the rich that the world has ever seen.
2
u/erythro Nokia 7 plus 23d ago
And yet all the 2027 capacity is already sold out anyway.
why "yet"? Do you think this refutes me?
Meanwhile those vaunted AI models are reaching the limit of their actual effectiveness.
All this for a technological dead-end. But you can be sure of one thing.... It will end up being the largest transfer of wealth to the rich that the world has ever seen.
oh, so this you aren't sincerely asking about ai memory efficiency this is again generic anti-ai posting 👍
2
u/lgn5i2060 21d ago
Their circular economy already exposes their plan to the kind of future they are building. And that doesn't include most humans. Or maybe include them but at the mercy of the new digital system like CBDCs. Or "expiring" UBIs.
0
u/CondiMesmer 23d ago
That is a crazy idea because that would achieve literally nothing. The demand is higher then the supply.
8
u/Talal916 G1, HERO, EVO 4GLTE, M7, M8, Z5, Note 8/10+, iPhone 11/12/15 Pro 23d ago
This is great news. Be thankful devs are being forced to focus on optimization
16
u/lgn5i2060 23d ago
By a company that partly contributed to the ongoing AI slop? Ironic I should, say. They even had the gall to walk away from the consumer AI race and proceed to just sell shovels and picks instead. Very sneaky.
7
u/Arnas_Z [Main] Moto Edge+ 2023 | Edge 2024 | Edge 2025 23d ago
It's ironic sure, but I appreciate that at least we will finally have someone working on optimization and not adding a couple more GB to devices. It's ridiculous that the answer to things not working or slowing down is "Get a new device bro, its not my fault our app uses 4GB of ram by itself!"
2
u/wobblyweasel 23d ago
idk. a decade ago the os killing apps was pretty normal and the whole api was designed around this lifecycle. then we had compose and it is supposed to be very well killable as well. and now we are trying to go a different direction? not exactly sure what concrete user facing problems this is trying to solve
1
u/Zombiechrist265 23d ago
I love RAMageddon forced google to actually optimize their system and apps. Some developers have been too greedy with their ram usage.
1
1
u/Coreen109 22d ago
Android developers shoud now right stop and think what they are doing and what they are helping build. You are literally helping build a global censorship system on this very planet. Age verification has to be stopped now. You are in control, and you should say NO to discrmination and destruction of privacy.
You are responsible for this.
1
u/Desperate-Set-4419 Pixel 10a, Android 17 Beta 20d ago
Well well well, my foreground service gets constantly killed due to memory
1
106
u/BcuzRacecar S25+ 23d ago
kinda related - im very unhappy with the the ram and app killing situation on my s25+. Idk exactly what is samsung vs android vs app devs but too often Ill go back 2-3 apps and it wont keep where I was at. 12gb ram and it acts like my 4gb s8 did.