What really happens when your phone runs out of RAM?

What really happens when your phone runs out of RAM?

Samsung Galaxy S25 Ultra RAM use

Robert Triggs / Android Authority

These days, high-end smartphones and even more affordable models ship with about as much RAM as a modern mid-range PC. And why shouldn’t they? We use our phones for various tasks, from flicking through countless apps to playing the latest high-end games. They all need RAM, and increasingly more of it, especially when it comes to chatting with a large language model or using AI to spruce up our media.

Can your phone even run out of RAM these days? It sounds unlikely, but I put it to the test.

Do you use your phone’s RAM management features?

6 votes

In theory, it is possible to run out of RAM; if you throw enough sufficiently large applications at your OS all at once, it’s technically possible to hit that limit. But what happens in those instances? Well, logic says those apps would be forced to close, they could hang, or the entire OS could become unresponsive. But that’s very unlikely to happen, and I tested this out to prove it.

How Android takes care of your RAM

Smartphone RAM

Robert Triggs / Android Authority

To keep Android running smoothly and responsive, the OS has a couple of tricks before it starts killing apps you might want to get back to quickly.

The first is compressing apps already in RAM using zRAM. zRAM is basically a compressed block of data that lives inside your RAM. It grows and shrinks dynamically, compressing memory pages to save space and decompressing them when needed. App memory that isn’t needed is seamlessly pushed and pulled to zRAM even before your phone starts running low on memory.

All Android devices use zRAM, with OEMs able to tune how large this compressed pool can grow to balance performance and responsiveness. The catch is that zRAM still uses real RAM, so compressing lots of stuff doesn’t always free as much memory as you might expect.

zRAM compression is Android’s chief tool to keep apps alive for when you need them.

If zRAM fills up, Android tries a couple more things: the kernel’s swap process (kswapd) will try to flush out memory that can be reloaded from storage, as this can be quickly recalled when required. Failing that, it can kick additional pages out of zRAM or, if available, push memory to a swap file on your phone’s storage.

However, the use of physical swap storage isn’t part of stock Android. Custom ROMs and some OEM “virtual RAM” implementations have dabbled in swap file use, but this is the exception and not the rule. If all that is exhausted, idle applications are ended to make room for active processes. However, exactly how phones handle this process varies by device manufacturer.

Samsung RAM Plus vs Xiaomi Memory extension

Samsung RAM Plus options

Robert Triggs / Android Authority

I recently had the pleasure of using the Samsung Galaxy S25 Ultra with 12GB RAM on board, which gave me the perfect opportunity to test out how Samsung’s RAM Plus management system works in the real world. I also have the Xiaomi 15 Ultra, which boasts “Memory extension” technology to augment your phone with additional memory.

My first question was: Does RAM Plus rely on traditional zRAM or actual swap space? This is a key distinction, partly because Samsung published a 2023 research paper on an “Adaptive Swap” idea that leverages both fast zRAM space and slower swap responsiveness to try to obtain the best of both. Samsung’s RAM Plus settings menu also states it “uses your phone’s storage space to provide virtual memory,” which certainly hints at swap use, even if it isn’t explicitly mentioned.

Every phone uses zRAM and some use swap space too. But not the S25 Ultra.

However, adjusting RAM Plus settings on the Galaxy S25 Ultra shows no changes in flash storage partitions or mention of swap spaces via adb shell commands like /proc/partitions or df -h. This strongly indicates RAM Plus only affects the zRAM target size, not on-storage swap. This doesn’t mean no Samsung phones use swap, but the Galaxy S25 Ultra doesn’t.

By contrast, adjusting Xiaomi 15 Ultra’s “Memory extension” option sees a decrease of free space in the /data and /storage/emulated directories (which are the same thing, just referenced differently). While I can’t track down exactly where this extra storage is being used without root access, the changes on reboot exactly match the amount requested by memory extension. At the same time, the total zRAM pool remains set at 16 GB regardless of the setting.

Samsung Galaxy S25 Ultra RAM Plus

Robert Triggs / Android Authority

Why have a toggle at all?

Returning to Samsung, changing the RAM Plus setting only adjusts the target amount of compressed swap memory (i.e. how much data the system tries to keep compressed in zRAM) rather than the raw size of the zRAM block device. As more data is compressed, zRAM uses more real RAM, which depends on the compression ratio, which varies with what’s being compressed and the algorithm used.

A higher RAM Plus setting (e.g., 8GB) means more apps stay alive in the background, but with potential slowdowns due to extra compression. A lower setting (e.g., 3GB) prioritizes speed at the cost of app retention.

On the S25 Ultra, Samsung doesn’t let you go below a 3GB zRAM target, even if you disable RAM Plus, which makes sense with 12GB physical RAM since zRAM probably won’t use more than 1GB anyway. However, this might not be the case for all of Samsung’s phones, especially budget models that have less RAM.

Samsung RAM Plus lets you optimize RAM use between app retention or extra responsiveness.

But if RAM Plus is just a variation on RAM use, why even bother giving the user control over it in the first place? Well, there’s a slight but sometimes tangible difference. In short, the option exists so you can choose whether your device should favor background app retention (bigger zRAM) or just‑in‑time responsiveness (smaller zRAM) — all with a simple slider instead of digging into kernel parameters.

The Xiaomi 15 Ultra has very different behavior; the handset always targets up to 16GB of memory to compress, but the amount stored in zRAM is backed by additional swap space to avoid killing apps in extreme use cases. Unfortunately, I’m unable to track exactly when compressed memory is kicked over to flash storage, but I imagine it’ll be only once a set amount of RAM has been taken up. With 16GB of RAM onboard, it’ll probably be quite challenging to kick the phone into using swap space. The drawback is that compressing and decompressing from storage is slower than RAM, even with today’s fast UFS storage.

What happens when you run out of RAM?

Recent apps page on a OnePlus phone.

Joe Maring / Android Authority

To see how this all works under pressure, I stress-tested both phones by gradually loading them up with apps and watching what happened to RAM and zRAM usage. Finally, I overloaded the web browser to consume 8GB of RAM. It’s worth noting that flash swap and zRAM are considered “SwapTotal” for Android’s RAM management, which means that it’s impossible to see precisely when or how much swap space phones like the Xiaomi use (at least not without rooting the phone).

The results are pretty much in line with what you’d expect. Running a few small applications comes nowhere near stressing the Galaxy S25 Ultra’s hefty 12GB RAM, and Xiaomi’s 16GB doesn’t break a sweat. zRAM use is light and flits in and out of real-time compression of some background tasks, but we’re talking tens of MB. There’s certainly no need for swap space here. While in this state, switching to and from apps is seamless, with no delay and no data loss.

Compression quickly kicks in, ensuring that the OS remains responsive when RAM is tight.

It’s only once we have several games and apps running at once that free RAM drops below 4GB and RAM management starts to ramp up. It varies depending on the workload, but zRAM use can hit high MBs and even a GB or more. Even so, games don’t have to reload completely, but I was kicked out of one or two active sessions, and web pages had to be refreshed. Still, I experienced nothing approaching a major system slowdown, even with multiple games loaded up. As we’ve said before, 12GB is absolutely plenty of RAM. Outside of cutting-edge, niche AI workloads, I suppose.

Xiaomi Memory Extention

Robert Triggs / Android Authority

Android’s default RAM management is very robust, then. I had to artificially bring things to a close with a 4GB web page to force anything approaching a mass culling of applications. Even then, One UI stayed snappy, and so did Xiaomi’s HyperOS. However, most larger applications had closed at this point, forcing me to reload them from scratch to start them up again.

It’s basically impossible to run out of RAM, as it’s managed dynamically.

When you do hit the RAM wall, Android simply starts closing idle apps. And thanks to zRAM (and swap, if used), that wall is far off in most real-world cases. But most importantly, it’s almost impossible to approach this point in regular use, thanks to zRAM compression. Phones that use additional swap space fare even better in terms of keeping apps open, but don’t feel quite as responsive as zRAM-only implementations. Not that I could notice on the Xiaomi 15 Ultra, but that’s probably an indication that 16GB is simply overkill for even a huge number of mobile applications.

One final note: swap doesn’t replace zRAM — it complements it. You won’t wear down your flash memory constantly writing to physical storage by enabling it; it just adds minor wear over time. What’s perhaps a bit more noticeable is that bringing back distant background apps from storage is slightly slower than decompressing from RAM, but at least you don’t have to load them up again.

With RAM capacities continuing to rise and Android’s memory tricks becoming ever smarter, swap space might never be essential. Still, it can be a helpful tool for budget or AI-heavy devices.

Source

📰 Crime Today News is proudly sponsored by DRYFRUIT & CO – A Brand by eFabby Global LLC

Design & Developed by Yes Mom Hosting

Crime Today News

Crime Today News is Hyderabad’s most trusted source for crime reports, political updates, and investigative journalism. We provide accurate, unbiased, and real-time news to keep you informed.

Related Posts