2

I cannot seem to get a straight answer on this, and that is the Overcommit Settings in the Android Kernel. I only have a basic understanding of it, that it allows the system(?) to only use a certain percentage of ram? Anyway, with my failed research attempts, there is very little on this subject, and often articles will conflict with each other. For example, in these articles:

https://forum.xda-developers.com/android/general/guide-comprehensive-guide-to-kernels-t3121088

https://forum.xda-developers.com/android/general/guide-comprehensive-guide-to-kernels-t3121088

They both say that overcommitting is bad and should be disabled. However, in a few other articles:

https://forum.xda-developers.com/showthread.php?t=1621808

They set the overcommit to 100% (Or just leave it at 50). I just want a plain and straight answer, what is the overcommitting ratio and how does it affect ANDROID specifically, one way or the other? (Battery, performance, stability)

Thank you very much!

(I am editing my Android Kernel [HotDog] with Kernel Adiutor)

EDIT: My phone is Android 7.1 with 2GB of ram

2
  • Quick note, I've also noticed that setting the overcommit to 0, it gives an average of 1000 mb free ram, whereas the default 50 gives 900mb free.
    – JCTechie
    Commented Mar 8, 2017 at 16:24
  • engineering.pivotal.io/post/… Seems to explain rather well.
    – codycoding
    Commented Jun 16, 2019 at 22:37

2 Answers 2

1

My understanding is this. basically the android system runs all the apps and determines when to give them memory and how much. when an app requests some RAM the system will set aside some ram for that app. apps dont always use as much ram as they request, so the system will actually tell the app it has X amount of RAM to use when in reality only Y amount of ram was set aside and X>Y is the ratio essentially. so 50% would mean that the system would attempt to set aside 50% less physical memory to this app than it wants but keeps it a secret from the app and then uses multitasking in order to try and give it ram as needed

1
  • Thank you very much! Does it affect the performance by setting it to 0 or 100%? It shouldn't affect battery because it's ram.
    – JCTechie
    Commented Mar 12, 2017 at 20:06
1

Changing overcommit_ratio is, like most Android tweaks, an optimisation myth. If you research these kernel parameters, you'd discover that the overcommit_ratio option only determines the overcommit allowed when the manual overcommit mode is enabled, i.e. overcommit_memory=2. No Android device has this set as far as I know, however, and the two devices I've tried enabling this mode have both resulted in system-wide malloc/fork failures no matter what the ratio was previously set to.

Disappointing that a good developer like the one(s) behind Kernel Adiutor didn't even bother to research this.

Overcommitting is good and necessary. Apps will always allocate more memory than they actually use, as can be seen in vss/rss/pss discrepencies. It seems the only valid modes for overcommitting memory in Android is to either heuristically determine the limit of overcommitting (i.e. overcommit_memory=0) which is the Linux default, or always succeed in any commits that aren't absurd and just let the LMK/OOM managers kill things off as necessary (i.e. overcommit_memory=1) which I think is the Android default (despite the docs saying otherwise).

In short, it doesn't matter what you set this to because it does literally nothing for typical (maybe even all) Android distributions. Any perceived performance enhancements are placebo.

EDIT: It seems that overcommit_memory=0 should only be used on systems that have a dedicated swap partition to act as a safetynet to OOM crashes when memory is actually full, but this setup is not ideal for Android - Android's LMK managed low-memory situations without the need for disk paging.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .