[Moto G 4G Android Development] Pupet_Master:
IMPORTANT: I think i reach the final build for this script. All in all i present two version of the script. One codename Balanced that is the initial script (and there for is the most balances i've got) and another codename Ultra Smooth as it is very smooth but may be too aggressive on background secondary services.

Hello, for all the Moto G users who have the crDroid ROM and have tried the Pink Kernel, i've made this topic so we can try to find the root from the performance issues with the combination of said ROM and Kernel.

For who follow my last post on both the thread of the ROM and Kernel, i had a theory about what was the issue.

After read the experience other users had with it and my own i came to the conclusion that the stability issue, force stop from heavy apps and even small reboots ("BSOD") came from a very different philosophy on the OOM (Out of Memory) configurations of the ROM stock Kernel (that don't have this issues) vs the Pink Kernel on this ROM.

With the Stock, i realize that we have much more free RAM (i got from 400mb free to 240mb free) then on Pink Kernel (that i was ranging from 280mb free to 144mb free). That is a big difference.

Our devices are amazing phones, but it RAM amount isn't the best now days, so i figured that heavy Apps (such as the Facebook one, the one who most had issues with the ROM+Kernel) just don't have much free RAM from the pool. So it hit the page file/swap (there for cause a very laggy experience and force closes) and if the page file/swap don't do the cut it reboot the phone.

On the stock kernel as it give much more free RAM it didn't had any of those issues (even though on my experience the Facebook App never run as smooth as the other apps, even on the stock kernel). So i tried my first attempt to remedy this issue.

As my Kernel management app of choice don't apply OOM settings after reboot (it go back to the stock one of the Kernel we have), and i like it as if it go wrong on boot it is ok again, i've made a simple script, so on every reboot it apply my settings and too that is a simple way that who don't use Kernel management apps can have this "fix".

I also don't like to use INIT.D for this as if it go wrong it will bootloop. With SManager (a free app on the play store) it is very safe if go wrong and if not.. it work just as INID.D in this case.

To who don't know how to use SManager, just get it on the play store. After open the app click on the menu button and choose new program. It will ask you to give a name, you can choose any one you like (i've choose OOM-FIX).

After give the name open it from the list within the app and click (to enable) the SU and BOOT option. After it click on the edit button so you can write the script.

On the script editor, here is the code of the script:

Now save everything and either run it or reboot.

If you do use a Kernel Management app who apply OOM custom settings on each reboot, this settings on the script represent:

This was the best middle ground i found from the Pinky Kernel OOM vs the Stock (with my settings i'm getting from 386mb free to 244mb free).

I only tester for two days so far, but my experience on Facebook (the app who most gave me trouble) was very satisfactory. It isn't 100% perfect but for my use it is a good 85% (must remember that even on the stock kernel it wasn't 100% good).

The app don't lag as much, only if we spam commands such as click on the back button more then once at the same time it lag more then acceptable. But scroll down on the timeline, messages and person profile was very good.

Open too many pages inside the app lag a little too but nothing close to force boot or even force close the app for me.

But i'm not the most heavy FB user, neither the most heavy Phone user.

That is where you guys come in. If you guys who use the amazing crDroid ROM and love the Pink Kernel want to keep this combination, try this script/OOM settings i just shared, so if it need more tweaks (and if it really is the cause of the issue) we can do it. As for my use it is fine, but i want to know about on other phones and users/uses.

Just to share the full spec and config of my phone, it is a Moto G 4G LTE XT1040 using the latest crDroid with the latest Pink Kernel. I am not a heavy user and my GAPPS is the minimum pack. I greenify almost all apps on the phone (including many system ones), i have a big wakelock setting to not allow apps to wakelock and all in all i do the best to only let the apps i want to run (and usually are the foreground ones i've choose to use).

How ever i do use also Xposed and a lot of custom tweaks.

My Pink Kernel configuration (With 3C Toolbox) is a CPU profile that i'll share:

Profile:

Intelliactive @ min:300mhz and max 1,18ghz

All cores setup as free

TCP/IP Algorithm: Veno

SD Cache: 512

I/O: ROW

Double tap to wake: On

When the screen is off i have a userspace profile locked at 300mhz min and max frequency.

So there you go, who want to use the ROM and Kernel try this script or OOM out (you can try a Tune for profiles like mine too in case to emulate what my phone got as a result) and post the results, if it got better, worse or if it fix.

For me the phone is very present to use, VERY smooth and the Facebook App is manageable now.

NEW: INIT.D script Download:

https://mega.nz/#!N4IiSboa!v4tSk1X_RZeGBJesrJbJUpJZvcdMiN2rTE4loTWHsYI

CHANGELOG:

v0.1:

v0.2:

v1.0:

v2.0a-Codename-Balanced:

v2.0b-Codename-Ultra_Smooth: