0

I have a Samsung Galaxy A20s with Android 11 and 2790 MB RAM. The phone was originally designed for Android 9.0 but now that it's been upgraded to 11; it's become slow and my RAM is always almost full and the Droid Hardware Info app says my Java Heap is 192 MB.

is there any way I could change the heap size? It's way too high for my A20s.

0

1 Answer 1

0

It seems like you use some sort of system info app that shows you a value and you assign a meaning to the value it never has:

Java Heap and it's size

The Java heap is (a bit simplified) the main memory pool of a Java application. Therefore if your used app shows you that the Java Heap is 192 MB then this means that the Java part of this Android app currently uses 192MB RAM (assuming the app developer has calculated the used RAM in a correct way, calculating the current heap size on Java is not that simple not sure if it is also that complicated on Android).

This also means the Java heap size of every Android app is different. This is not a general limit but just the RAM usage of each Android app.

Your question was how to change that value - as you can see this question doesn't make sense as this is not a configured value somewhere in the system but just the RAM usage of an app.

If you have RAM problems make sure you don't have apps running you don't use (disable or uninstall unused apps). Also for some common XXL apps like Facebook there are lite versions available which are designed to consume less resources like RAM. Switch to those lite versions where applicable would be another recommendation to save RAM.

2
  • the app shows the heap size for all android apps not itself. it's just like cpu-z on desktop. look this phone, A20s' hardware was designed for android 9, now it's been upgraded to 11 and can't handle it. it's slow to use. but if we change the heap size to 64 I'm sure it'll be able to function much better.
    – user366448
    Commented Jan 17, 2022 at 4:54
  • @mohsentux Usually the heap size is identical for all apps (unless the app declares largeHeap="true" in it's manifest. If I have an phone that doesn't run smoothly with Android 11 because of memory problems why should allowing every app more memory improve the situation? If RAM was already short with the lower heap size, increasing the heap size can make the RAM shortage only worse (if the app use the extra RAM at all). Increasing the heao size is only useful if you have apps that crash with an OutOfmemoryError (because their heap is too small).
    – Robert
    Commented Jan 17, 2022 at 8:03

You must log in to answer this question.