[Sony Cross-Device General] slaid480:
About Android tweaking

This Post is reserved for sharing various information about Scripts/Tweaks used to Tweak the Android system through the Linux kernel.

The main goal of using scripts and tweaks:

Scripts and tweaks are used :

-Improve Performance and GUI Smoothness.

-Improve Battery Life.

-Tweak and Optimize the Android engine!

Useful Info About Tweaks:

-LMK:

The Low Memory Killer is a constant debate between more free RAM and more multitasking capabilities as free RAM (more than 60MB free) is actually wasted RAM.

The Low Memory Killer is actually a feature in the Android OS used to improve memory management.

This is an important feature due to the perennial problem of having low free memory causing lagginess and slowness in launching apps. When you have free memory lingering around the number of 40MB or less, the Android OS just lags like hell.

What this would mean is, you would want to tweak the LMK to not have the situation of it having less than 40MB (or even close to that).

The modern Linux machine in the Android ecosystem relies on a mechanism called Low Memory Killer (LMK) to consistently free up RAM. This is due to Android's internal mechanism of caching apps (and never fully exiting them) when you press the back button. This is to enable faster app switching and provide a seamless experience for apps usage model. Android also, by itself will also constantly look for often used apps to cache them for faster app opening. This will happen even before your system fully boots.

Now, when you mention LMK, the most obvious thoughts that come up are minfrees and Out Of Memory (OOM) groupings. Yes, those two are integral parts when it comes to LMK. The issue here is that no one actually mentioned that there are two LMK systems in Android, that being:

- Linux LMK

- Android Dalvik VM LMK

-Journaling/Barriers:

-This has been a touchy subject here in XDA for most people who debate about it. Most recently,Some Scripts included a way to disable journalism on these partitions:

/system (System is read only, it's safe to remove journalism. However, you will not see speed increase by removing it as you're not writing onto /system 99.99% of the time unless you're using Titanium backup to remove system apps or copying init.d scripts to it)

/cache (Cache can be rebuilt on the fly. Data corruption on it is not game breaking)

/data (All of your data on your phone is here. Removing journalism can risk data corruption. Read more below)

On whether we need journalism or not, I will pose this situation:

Journalism is required to maintain data consistency in events that could lead to data corruption. Data could get corrupted in a number of situations:

- Misbehaving app that constantly writes without syncing/committing data to the disk

- Power loss due to forced reboots or bootloops when data is partially written/committed into disk

-Memory leaks:

If you found out that your Android is laggy after sometime and a reboot will make it faster, then you're experiencing memory leaks. "free" is a command to show your currently free memory. It will not necessarily be the same value as your phone's free memory.

-Busybox:

Busybox is required to perform all of your superuser activities in your android phone. There are some problems associated with this when ROM developers decide to use a certain version of Busybox that are incompatible with the binaries that we use in our phones.

-MinFree:

Minfree is part of the Kernel used to multitasking and It differs from a Phone to another because of the RAM available in users space.

-Network Tweaks:

There are some Tweaks that are used to increase the speed of your Network browsing,downloading and uploading

-Build.Prop Tweaks:

Those Tweaks can generally be found in Build.prop /system and they are used to optimize overall system speed and battery

-SD Card Speed Fix:

This is a Tweaks that Has the goal of increasing the read-ahead speed of your SD Card,and that by improving your SD R/W speed.

-Smoothness Tweaks:

Well with the Linux Kernel there is a possibility to add some Tweaks to optimize the GUI Smoothness.

-Entropy generator engine:

This engine can reduce lag by keeping a section of the Android file system (/dev/random) full of random bits so that the system does not have to wait for the file system to generate them.

-Zipalign:

Zipalign is a tweak used to optimize Android application (.apk) files. The purpose is to ensure that all uncompressed data starts with a particular alignment relative to the start of the file. Specifically, it causes all uncompressed data within the .apk, such as images or raw files, to be aligned on 4-byte boundaries. This allows all portions to be accessed directly with mmap() even if they contain binary data with alignment restrictions. The benefit is a reduction in the amount of RAM consumed when running the application.

Credits::

Well,what I can say is that I shared those useful Info after some research and my experience with Linux/Unix,and those some of My main Target that I use to find some of the useful info:

-XDA Forums

-Goolge