[HTC One X] mox123:
Improve your One X multi-tasking using this simple and quick script!

User Feedback from this script:

"Nubzori: Thank you so much. After 10mins of testing, loaded bunch of apps, news, twitter, pulse, xda, chrome, clock, task manager, none of these refreshed"

Note: this script only works on roms that support init.d, it's been brought to my attention that init.d is not supported on some stock roms/kernels although it must be said; Why the hell would anyone want a stock rom??

UPDATE 15/06/12

- Thanks to Orical who has advised me this link here is a solution to those having problems with getting init.d scripts to work. This basically gives you the ability to enable init.d scripts in any rom!!!

Steps to installing script - EASIEST METHOD

1. Download this script of your choice and transfer to your phone (using USB cable or download direct to your phone or AIRDROID or whatever)

2. Rename from multitasking.txt to just multitasking (without any extensions) and place this in your /etc/init.d/ or system/etc/init.d (if you cannot see this, make sure your es file explorer is showing hidden files and folders which can be changed within the settings of es file explorer, also you need to make sure you go up to root directory which is again enabled within es file explorer)

3. You must be rooted to access this folder (make sure you set es file explorer to go up to root directory). These scripts alter the minfree values in your lowmemorykiller system module.

4. Once you have moved script file to init.d to mark as executable by clicking on script and setting permissions as executeable within es file explorer.

5. OR Just open the file and you can find several options, one you need is 'linux handler', choose that and next select execute option. It will now executed automatically.

Alternative method of installing script:

adb remount

adb push C:\Users\your name here\Desktop\multitaskingxtremextra system/etc/init.d

adb shell

chmod 644 system/etc/init.d/multitaskingxtremextra

adb reboot

From what I know of, the android system generally handles around about 5/6 apps in memory without any problems, any more apps and then you start getting refreshes, I've tested using LBE firewall (running as service), battery status, firefox with multible tabs open, gmail, messaging, gallery and the sense launcher (as this is an app as well). Any more and it starts recycling ram for some reason and you will get refresh on some apps (depends on which app)

Troubleshooting:

Can't find init.d, here is the answer:

Use the root explorer to copy it to system/etc/init.d

Just open the file and you can find several options, one you need is 'linux handler', choose that and next select execute option. It will now executed automatically.

The default values for the One X are:

STOCK ONE X TEGRA:

8192, 10240, 12288, 14336, 16384, 20480

My multitasking script alters this to:

2560,4096,6144,7680,8704,10240

My multitaskingxtreme script alters values to:

1536,2048,3584,5120,8704,10240

My multitaskingxtremeextra has the xtreme script as well as:

Dirtybackgroundratio 70

Dirty Ratio 90

VFScachepressure 10

And kill oom allocating task 1

my multitaskingultimate has the same as multitaskingextremeextra except the minfree values are more aggressive for the best multi tasking you can get on the one x

512,1024,1280,2048,3072,4096 - this is the best settings I have used for multitasking and have run 6/7 apps and some cases more without refreshing on a full SENSE 4 rom which is impressive if you ask me, the combination of apps where Firefox, Chrome, Gallery, Youtube, Dialer, etc.

You should notice that most apps will not reload when multitasking (except if you are intense gaming such as shadowgun or something intense like riptide), in some cases too many apps running will cause refresh if multi tasking, take note in the fact that htc senses software uses up alot of ram leaving little free as it is for other apps.

If you want to return to default values, simply delete the script from your init.d and reboot your android phone

If this has helped you please hit the Thanks button rather than post thanks!!

My test was using chrome beta, ebay, gallery, file explorer, ebookdroid, whatsapp, gmail, text message and all did not refresh whilst using,

I will also experiment with different scripts & methods and post any alternatives that may further improve multi tasking on the one x.

NOTE: I hold no responsibility should you damage your phone in anyway using this script. However damage is unlikely.

Information:

min free kbytes (vm.min_free_kbytes)

This is used to force the Linux VM to keep a minimum number of kilobytes free. The VM uses this number to compute a pages_min value for each lowmem zone in the system. Each lowmem zone gets a number of reserved free pages based proportionally on its size. Default is 2048kb.

dirty ratio (vm.dirty_ratio) and dirty background ratio (vm.dirty_background_ratio)

This controls how often the kernel writes data to "disk" (in our case the internal microSD system card, not the removable microSD card). When your apps write data to disk, Linux actually doesn't write the data out to the disk right away, it actually writes the stuff to system memory and the kernel handles when and how the data is actually going to be flushed to the disk. These values represent a percentage, the higher the percentage, the longer it waits to flush, the lower the percentage, the more often flushes will occur. Now remember, we are dealing with solid state storage, not the traditional disk platter and spindle. So we are actually able to delay flushes a little longer with solid state versus a traditional hard drive disk.

VFS Cache Pressure (vm.vfs_cache_pressure)

Now here is where it gets interesting! File system cache (dentry/inode) is really more important than the block cache above in dirty ratio and dirty background ratio, so we really want the kernel to use up much more of the RAM for file system cache, this will increas the performance of the system without sacrificing performance at the application level. The default value is 100, as a percentage, and what you want to do is lower the value to tell the kernel to favor the file system cache and not drop them aggressively.

oom allocating task (vm.oom_kill_allocating_task)(enable or disable, generally in Linux this value is either a "1" or a "0," representing as on or off.)

This enables or disables killing the OOM-triggering task in out-of-memory (oom) situations. If this is set to zero, or disabled, the OOM killer will scan through the entire task list and select a task based on heuristics to kill. This normally selects a rogue memory-hogging task that frees up a large amount of memory when killed. If this is set to non-zero, or enabled, the OOM killer simply kills the task that triggered the out-of-memory condition. This avoids the expensive task list scan, which can take mass amounts of time and "hang" or freeze the system.

This thread would like to thank the following:

rayford85 - for pointing out #!sysbin in script which i stupidly left out and alternative installation method

Nubzuri - for pointing out to those who could not find init.d

rycon33 - for pointing out that init.d not supported on some stock kernels/roms

My MODS

----------------------------------------------------

[MOD] Improve Multi-tasking on HTC One X

----------------------------------------------------

[Currently owned devices]

- HTC One X Tegra 3

- Motorola Xoom

- HTC Sensation

- HTC Desire HD