How much are the android

How much RAM does a smartphone actually need? We asked the experts

Buying a smartphone today can be confusing. Long specification sheets are crammed with numbers, and their relationship with real-world performance is not always clear. One of the most misunderstood of all those specs is RAM, or Random Access Memory.

If you’re wondering how much RAM your smartphone needs, then you’re not alone. This question has popped up again and again since the dawn of the smartphone. We decided to ask some experts about how much RAM the average person really needs, what it does, and how it works.

What does RAM do?

“Smartphones have come a long way in the last few years and do more for us now than ever,” Vishal Kara, head of product at Piriform (the makers of CCleaner for Android) told Digital Trends. “As we perform more and more tasks using our smartphones, more RAM is necessary for them to continue functioning efficiently.”

We install apps and games into internal storage, our CPU (Central Processing Unit) and GPU (Graphics Processing Unit) deal with processing, so what does RAM do?

“Smartphones require instant access memory for multitasking, which is what RAM delivers,” Kara said. “Essentially, RAM keeps all your operations running at once.”

“There is no right or wrong to how much RAM a smartphone requires”

When you run an app or game on your phone, it’s loaded into RAM. As long as an app is still in RAM, you can jump back into it where you left off without reloading. This is why RAM is important for multitasking. The loaded apps stay there until your RAM fills up and needs to flush something to make room for something else.

In theory, more RAM means that you can have more processes and therefore more apps running at once.

“There is no right or wrong to how much RAM a smartphone requires, although RAM plays a big part in how fluid and seamless our smartphone experience is,” Kara explains. “Unlike PCs, where a few seconds delay in an app loading is acceptable, we expect apps to load instantly on our smartphones even when we’re on the go.”

RAM also enables processes to run in the background. Some of these background processes, such as your phone checking for email, are really useful. Others, like a piece of carrier bloatware or an app that you never use, are not.

The rise of RAM

The first Android smartphone, the T-Mobile G1 or HTC Dream, had just 192MB of RAM and the original iPhone got by with 128MB of RAM. Those numbers have climbed steadily over the last decade or so, with an occasional leap prompting a new round of discussion. Samsung’s latest flagship, the Samsung Galaxy S21 Ultra, comes with the option for an astounding 16GB of RAM.

With 16GB of RAM, the S21 Ultra has twice the amount of RAM as its smaller sibling, the Galaxy S21 — which seems odd, when you think about it. Both phones have the same processor and similar other specs, so why the dramatic jump in RAM?

“Generally speaking, more RAM is better, and performance isn’t hampered by having more RAM,” John Poole of Primate Labs (makers of benchmarking software Geekbench 4 for iOS and Android) explained to Digital Trends. “But is it really necessary?”

The amount of RAM we need is certainly growing. The average smartphone user launches has 110 apps installed and uses 46 different apps in a month, according to App Annie’s analysis of the second quarter of 2020. Digging into the memory tab in the settings of the Samsung Galaxy Note 20, which has 8GB of RAM, reveals 4.7GB of memory being used, with 748MB reserved, and 2.6GB free. That’s a lot being used, just as background use, and clearing background apps only frees up to 3.5GB of space.

Читайте также:  Блокировка андроида одним касанием

We also have more storage than ever. The Galaxy S21 Ultra with 16GB of RAM has 512GB of storage. That’s enough space for a lot of apps. Poole also points to the fact that software is growing bigger and more complicated, cameras are shooting larger images in RAW format and performing more image processing, and screens are getting bigger, but he’s still skeptical about the need for large amounts of RAM.

“My feeling is that some vendors will engage in a specifications war where they’ll overprovision the amount of RAM simply because it’s a selling point”, Poole said. “They can say ‘look at how much more RAM our phone has than our competitors’ phone, clearly our phone is better.’” It’s a sentiment that was shared by Huawei executive, Lao Shi, back in 2017.

Why having more RAM isn’t always better

If RAM offers potential performance improvements and greater convenience, then you may be wondering: What’s wrong with having more of it?

If you aren’t using the RAM, then it may be a drain on your battery.

“The more RAM you put into a phone, the more power that will draw and the shorter your battery life will be,” Poole said. “RAM takes up the same amount of power regardless of what’s in it — if it’s an application or it’s just free, you’re still paying for it in terms of power.”

In other words, if you aren’t using the RAM, then it may be an unnecessary drain on your battery. Those background processes that we mentioned earlier also have an associated cost, as anyone who has used the Facebook app on Android will know.

“Even if they’re not doing much, they can cause the processor to spin up to service any work that they have to do and that can contribute to energy drain,” Poole said.

The iPhone in the room

Android phones have jumped from 4GB to 8GB RAM as standard, and we’re now seeing phones with 12GB and 16GB of RAM — but Apple’s iPhone has always gotten by with less.

Apple executives have traditionally remained tight-lipped about how much RAM is in the iPhone — it’s not a spec they talk about. But we know from teardowns the iPhone 12 has 4GB of RAM, and even the current top-of-the-range iPhone 12 Pro Max manages with 6GB of RAM.

Andrew Martonik/Digital Trends

Apple achieves comparable performance with less RAM because of fundamental differences in how the iOS and Android platforms handle memory management. Android relies upon something called garbage collection, while iOS takes a reference counting approach. A brief web search will reveal that the debate on which is better rages on, but it seems to be generally accepted that garbage collection requires more memory to avoid performance problems.

They may be different, but both platforms have a system of memory management that dictates what the RAM does. Because of this, you may not actually see any performance boost by simply adding more RAM — you would have to also tweak the memory management rules to take advantage of it. To what degree manufacturers are actually doing this is unclear.

Free the RAM

“Users have been conditioned to believe that free RAM is an indicator of good performance from the days of PCs with limited memory, where this was a reasonable belief,” Kara said. “Nowadays, with more memory available, the perception that free RAM is an indicator of performance is a misconception. In fact, for a smartphone it’s the opposite.”

Читайте также:  Открытие шлагбаума с андроид

This misconception that having free RAM is a positive thing persists. Also, if you’re in the habit of clearing away your open apps, you should probably stop doing it because it isn’t helping. It won’t save battery life or make your phone run any faster, in fact, it can have the opposite effect.

“The operation of loading an app from storage into memory requires a lot of processing power, which results in higher power consumption,” Kara said.

Most manufacturers still provide utilities that allow you to review RAM and sometimes to free it up and close processes. Third-party task killer apps were also big for a while, but Poole describes them as “snake oil.”

“People want to see their RAM free, viewing it as headroom to work in,” says Poole. “But it’s better if your RAM is being used.”

Ultimately, how much RAM your smartphone needs depends on how you use your smartphone, but it’s no longer the problem it once was. Maybe a few power users will be able to feel the benefit of 12GB, and you might argue that 16GB is future-proofing. But anything over 8GB is probably overkill for the vast majority of people today.

Источник

What is the maximum amount of RAM an app can use?

I am quite curious about this question concerning the memory management of the Android operating system so I hope for a quite detailed answer on that topic.

What I would like to know:

  • What is the maximum amount of memory (in megabytes / as percentage of the total RAM) that an Android application (that is not a system app) can use?
  • Are there any differences between Android versions?
  • Are there any differences concerning the manufacturer of the device?

And most importantly:

  • What is considered / what does it depend on when it comes to the system determining how much RAM an app can use at runtime (assuming that the memory maximum per app is not a static number)?

What I have heard so far (up until 2013):

  • Early Android devices had a per-app cap of 16MB
  • Later this cap increased to 24MB or 32MB

What makes me very curious:

Both of these limits are very low.

I have just recently downloaded the Android Task Manager to check my devices RAM. What I have noticed is that there are applications using around 40-50 megabytes of RAM, which is obvioulsy more than the mentioned maximum RAM usage of let’s say 32 MB. So how does Android determine how much RAM an app can use? How is it possible that apps exceed that limit?

Furthermore, I noticed that some apps of mine crash (killed by the system?) with an OutOfMemoryException when using around 30-40 Megabytes. On the other hand, I have apps running on my phone using 100 MB and more after some time (probably due to memory leaks) that do not crash or get killed off. So it obviously also depends on the app itself when it comes to determining how much RAM can be spared. How is this possible? (I conducted my tests with an HTC One S with 768 MB RAM)

Disclaimer: I am NOT affiliated with Android Task Manager app in any way.

4 Answers 4

What is the maximum amount of memory (in Megabytes / as percentage of the total RAM) that an Android application (that is not a system app) can use?

That varies by device. getMemoryClass() on ActivityManager will give you the value for the device your code is running upon.

Are there any differences between the Android versions?

Yes, insofar as OS requirements have increased over the years, and devices have to adjust to match.

Are there differences concerning the manufacturer of the device?

Yes, insofar as manufacturers manufacture devices, and the size varies by device.

Which «side factors» are taken into consideration when it comes to determining how much RAM an app can use?

I have no idea what «side factors» means.

Early devices had a per-app cap of 16MB; Later devices increased that to 24MB or 32MB

That’s about right. Screen resolution is a significant determinant, as larger resolutions mean larger bitmaps, and so tablets and high-resolution phones will tend to have higher values yet. For example, you will see devices with 48MB heaps, and I wouldn’t be surprised if there are values higher than that.

How is it possible that apps exceed that limit?

You assume that the author of that app knows what (s)he is doing. Considering that memory usage of an app is difficult for a core Android engineer to determine, I would not assume that the app in question is necessarily providing particularly accurate results.

Читайте также:  Android sdk unity 2017

That being said, native code (NDK) is not subject to the heap limit. And, since Android 3.0, apps can request a «large heap», usually in the hundreds of MB range, but that’s considered poor form for most apps.

Furthermore, I noticed that some apps of mine crash with an OutOfMemoryException when using around 30-40 Megabytes.

Bear in mind that the Android garbage collector is not a compacting garbage collector. The exception really should be CouldNotFindSufficientlyLargeBlockOfMemoryException , but that was probably deemed too wordy. OutOfMemoryException means that you could not allocate your requested block, not that you have exhausted your heap entirely.

It’s the end of 2018 so things have changed.

First of all: run your app and open Android Profiler tab in Android Studio. You will see how much memory it consumes, you will be surprised but it can allocate a lot of RAM.

Also here is a great article in official docs with detailed instructions on how to use Memory Profiler which can give you an in-depth look of your memory management.

But in most of the cases, your regular Android Profiler will be enough for you.

Usually, an app starts with 50Mb of RAM allocation but instantly jumps up to 90Mb when you start loading some photos in memory. When you open Activity with a ViewPager with preloaded photos (3,5Mb each) you can get 190Mb easily in seconds.

But this doesn’t mean you have issues with memory management.

The best advice I can give is to follow the guidelines and best practices, use top libraries for image loading (Glide, Picasso) and you’ll be OK.

But if you need to tailor something and you really need to know how much memory you can allocate manually you can get total free memory and calculate a pre-determined portion (in %) out of it. In my case, I needed to cache decrypted photos in memory so I don’t need to decrypt them everytime user slides through the list.

For this purpose you can use ready to use LruCache class. It’s a cache class which automatically tracks of how much memory your objects allocate (or the number of instances) and removes the oldest to keep the recent by their usage history. Here is a great tutorial on how to use it.

In my case, I created 2 instances of caches: for thumbs and attachments. Made them static with singleton access so they are available globally throughout the app.

This is how I calculate available free RAM and how much I can bite out of it:

And this is how I use it in Adapters to get cached image:

and how I set it into cache in background thread (regular AsyncTask):

My app targets API 19+ so devices are not old and these portions of available RAM are good enough for cache in my case (1% and 3%).

Fun fact: Android does not have any APIs or other hacks to get the amount of memory allocated to your app, it’s calculated on the fly based on various factors.

Источник

Оцените статью