FORUMS
Remove All Ads from XDA

 View Poll Results: Has your multitasking been improved

Yes, significantly.
 
105 Vote(s)
34.88%
Yes, a little bit
 
46 Vote(s)
15.28%
Can't tell
 
91 Vote(s)
30.23%
No improvement
 
39 Vote(s)
12.96%
Seems worse
 
20 Vote(s)
6.64%

S6 Ram Management Discussion(Partial Fix)

3,057 posts
Thanks Meter: 3,142
 
Post Reply Email Thread
Since we've been talking about this pretty extensively in a different thread I figured I would make a new thread for discussing, troubleshooting and attempting to improve the ram management issue on the S6.

Hopefully some good will come of this

So far this Is what we've got:

Should work on all variants including the edge and possible on other Samsung devices.

Thanks to @mikeyinid for finding these and @s.rapp for answering questions, and making the instructions easier to understand
And anyone else who I may have missed who helped contribute.

Prerequisites:
-A rooted device
-A root file explorer/manager app
-A backup of your original build.prop to be safe

Explanation: (From @mikeyinid )
Here is a quick rundown on how this came about, and what we actually know.

Since I purchased the S6 on release day, I've been messing with certain things, as you can see from the ROM I posted, Looper(shameless plug). Debloating Samsung apps really helped with battery life and I was pretty happy with the results. But like so many other people, I didn't understand why my S6 killed apps so aggressively. Initially I thought it might be the memory leak we all know so much about in 5.0. So, I did a little research and found the patch for that. While it did help keep the device stable over time, apps were still being killed with no prejudice. All this time I noticed really useless services running in the background, often stuff I'd never even opened. I studied LMK and started messing with those settings. After a month of trying everything I could find documented, I was ready to give up. Yesterday I was looking through the services.jar smali for the 37,875th time and realized the DHA referenced in there has to have something to do with memory management. I kept overlooking it because I hadn't seen mention of it anywhere else. I am no smali guru, as some of you know. But it was pretty obvious DHA was influencing memory management to some extent. Samsung, although leaving us in the dark on this, was kind enough to give us props to set the values for DHA. I pulled a few that seemed relevant, added them to my build.prop, and what do you know. For the first time in almost two months of tinkering, I saw an improvement in the way my device was managing memory.

The thing everyone needs to understand; I have no clue what DHA is. It overrides every aspect of Googles LMK and seems to do so in a way that makes more sense. I'm sure someone with more knowledge than myself will be able to tune this to the point the S6 will be the multi-tasking champ. There are several other props in the smali that are probably useful. I will try to get them all with their default values posted today. This has been pretty exciting for me, I spent way to much time trying to figure out the issue to not make some sort of progress. I hope you guys enjoy the tweaks, and I hope it helps sway those of you on the fence about keeping this device to stay. It's only gonna get better

Instructions:
First find your build.prop. This is located in /system. to get to /system you need to go to the root directory using a file explorer and then go to the system folder. The build.prop will be in there. You can also use and app such as build.prop tweaker but its a bit harder (imo)

In your build.prop scroll to the very bottom and paste this in:
Code:
# MultiTasking Tweaks
ro.config.dha_cached_max=15
ro.config.dha_cached_min=4
ro.config.dha_empty_max=36
ro.config.dha_empty_min=9
ro.config.dha_empty_init=36
ro.config.dha_lmk_scale=0.545
ro.config.dha_update_max_count=5
ro.config.dha_step=2
ro.config.dha_th_rate=1.4
ro.config.dha_defend_th_level=0
ro.config.64bit_lmk_enable=true
ro.config.sdha_apps_bg_max=70
ro.config.sdha_apps_bg_min=8
ro.config.dha_ils_enable=true
ro.config.dha_ils_dyna_lmk=true
ro.config.dha_ils_rate=1.5
Now you need to find and remove any duplicate build.prop lines which may cause an issue. So look through the build.prop and remove any lines that look like these(Not the ones you just added at the bottom!):

ro.config.dha_cached_max=
ro.config.dha_empty_max=
ro.config.dha_th_rate=
ro.config.dha_lmk_scale=

Finally reboot your device and report back here!

Video Tutorial (courtesy of @Thin_Bezel )

https://youtu.be/d-vaLXF0OxY

A note from @mrapp :
"The major addendum here seems to be that when using this build.prop apps like Chrome and and those calling webpages via Webview (Tinfoil for Facebook) still suck. The kernels being tested at the moment don't appear to have this issue, so if you're capable of flashing kernels I personally recommend checking out the Vindicator thread if you're on T-Mobile/W8 or UniKernel (universal) if you're on any other device. UniKernel tests may or may not be edge friendly, so always make a backup. Lots of people have gotten in to trouble today. Don't be one of them!"

Please note we are constantly experimenting with different values so these are subject to be updated rather frequently
The Following 39 Users Say Thank You to Xileforce For This Useful Post: [ View ] Gift Xileforce Ad-Free
 
 
5th June 2015, 08:03 PM |#2  
Senior Member
Flag Piñas
Thanks Meter: 194
 
More
As I was saying before, Maybe someone can try compare Zenfone 2 services.jar with the one in samsung galaxy s6.

The Asus Zenfone 2 is knowed to had a great multitasking experience, it can keep a loot of apps even in his 2GB version, and remember that Zenfone is in Android 5.0 and don't have any problem with multitasking.

I already downloaded the firmware for Zenfone and decompiled his services.jar if someone like to try something, here is attached:
Attached Files
File Type: zip services.zip - [Click for QR Code] (1.97 MB, 668 views)
The Following 2 Users Say Thank You to iFlasher For This Useful Post: [ View ] Gift iFlasher Ad-Free
5th June 2015, 08:21 PM |#3  
mikeyinid's Avatar
Senior Member
Flag Boise
Thanks Meter: 4,225
 
More
Quote:
Originally Posted by iFlasher

As I was saying before, Maybe someone can try compare Zenfone 2 services.jar with the one in samsung galaxy s6.

The Asus Zenfone 2 is knowed to had a great multitasking experience, it can keep a loot of apps even in his 2GB version, and remember that Zenfone is in Android 5.0 and don't have any problem with multitasking.

I already downloaded the firmware for Zenfone and decompiled his services.jar if someone like to try something, here is attached:

I'll take a look at it, but I've already gone through several different services.jar trying to find anything that might make a difference. Everything appears to be exactly how Google intended it to be.
The Following 4 Users Say Thank You to mikeyinid For This Useful Post: [ View ] Gift mikeyinid Ad-Free
5th June 2015, 08:25 PM |#4  
Xileforce's Avatar
OP Senior Member
Thanks Meter: 3,142
 
Donate to Me
More
Quote:
Originally Posted by mikeyinid

I'll take a look at it, but I've already gone through several different services.jar trying to find anything that might make a difference. Everything appears to be exactly how Google intended it to be.

I also noticed that Samsung uses the ramdisk to set VM memory settings and lmk settings rather than actually modifying the source for some reason. I tried removing all of these and letting the settings be stock google but that also made no difference

Sent from my SM-G920T using XDA Free mobile app
The Following 2 Users Say Thank You to Xileforce For This Useful Post: [ View ] Gift Xileforce Ad-Free
5th June 2015, 08:57 PM |#5  
mikeyinid's Avatar
Senior Member
Flag Boise
Thanks Meter: 4,225
 
More
Quote:
Originally Posted by Xileforce

I also noticed that Samsung uses the ramdisk to set VM memory settings and lmk settings rather than actually modifying the source for some reason. I tried removing all of these and letting the settings be stock google but that also made no difference

Sent from my SM-G920T using XDA Free mobile app

Right, all of that can be controlled with init.d scripts. i set the values ridiculously high and can see that that scripts actually work. Then going the other way no matter how low I set them or even disable them, there is no difference. Still can't have more than 5 or so apps open.
The Following 3 Users Say Thank You to mikeyinid For This Useful Post: [ View ] Gift mikeyinid Ad-Free
5th June 2015, 09:06 PM |#6  
Xileforce's Avatar
OP Senior Member
Thanks Meter: 3,142
 
Donate to Me
More
Quote:
Originally Posted by mikeyinid

Right, all of that can be controlled with init.d scripts. i set the values ridiculously high and can see that that scripts actually work. Then going the other way no matter how low I set them or even disable them, there is no difference. Still can't have more than 5 or so apps open.

What's a good test to see if memory management is improved? I've done some mods to lmk in my latest kernel and want to see if it helps any.

Sent from my SM-G920T using XDA Free mobile app
The Following User Says Thank You to Xileforce For This Useful Post: [ View ] Gift Xileforce Ad-Free
5th June 2015, 09:09 PM |#7  
mikeyinid's Avatar
Senior Member
Flag Boise
Thanks Meter: 4,225
 
More
Quote:
Originally Posted by Xileforce

What's a good test to see if memory management is improved? I've done some mods to lmk in my latest kernel and want to see if it helps any.

Sent from my SM-G920T using XDA Free mobile app

just open apps, never hit the back button, then switch between them using recents.
5th June 2015, 10:25 PM |#8  
Xileforce's Avatar
OP Senior Member
Thanks Meter: 3,142
 
Donate to Me
More
Quote:
Originally Posted by mikeyinid

just open apps, never hit the back button, then switch between them using recents.

Hmmm...idk still seems pretty mediocre :/ not sure if better or worse.

Sent from my SM-G920T using XDA Free mobile app
6th June 2015, 12:39 AM |#9  
Senior Member
Flag Howell, NJ
Thanks Meter: 455
 
More
Quote:
Originally Posted by Xileforce

Hmmm...idk still seems pretty mediocre :/ not sure if better or worse.

Sent from my SM-G920T using XDA Free mobile app

Tried it on your latest kernel and it seems to be the same.
6th June 2015, 12:45 AM |#10  
Xileforce's Avatar
OP Senior Member
Thanks Meter: 3,142
 
Donate to Me
More
Quote:
Originally Posted by NJGSII

Tried it on your latest kernel and it seems to be the same.

Yea figured...the issue apparently isn't the lmk then...

Sent from my SM-G920T using XDA Free mobile app
6th June 2015, 02:00 AM |#11  
mikeyinid's Avatar
Senior Member
Flag Boise
Thanks Meter: 4,225
 
More
Quote:
Originally Posted by Xileforce

Yea figured...the issue apparently isn't the lmk then...

Sent from my SM-G920T using XDA Free mobile app

I don't know a whole about kernel stuff. Does there happen to be any oom_adj stuff in there?

I'm losing hope that this will be fixed with any update. I think moving to arm64 may have shot Samsung in the foot. What is the other arm64 lollipop device samsung has released? Note 4?.

---------- Post added at 07:00 PM ---------- Previous post was at 06:57 PM ----------

Quote:
Originally Posted by Xileforce

Yea figured...the issue apparently isn't the lmk then...

Sent from my SM-G920T using XDA Free mobile app

It's not. It has nothing to do with lmk. I've messed with every possible scenario, pulled in stuff from cm and see no difference. Even changing oom_adj values in services.jar makes zero difference.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes