yashsingh1/xdaforums huggingface dataset:
[LG Optimus 2x] squide:
======

Preface

======

The script is actually Base on Juwe11's RAM script

which you can found here... http://xdaforums.com/showthread.php?t=1111145

==========

Main Content

==========

The adj value of his script is a bit too tight for Our O2X...

so the Launcher is killed quite often if many apps opened in the background.

Here's the adj value changes I made, originally, Juwe11's values are..

"0,1,2,4,6,15" and I change it to, "0,1,2,7,8,9"

the forth value is for HIDDEN_APP_MIN_ADJ, which including the Launcher (I'm using LauncherPro) belongs to this category when you open some foreground application.

the default android value for this is also 7, and I find the OOM value for Launcher is 6 usually... so Juwe11's "4" will lead to our Launcher being Killed, keep it at 7, never tried to have mine killed yet.

The last 2 vaule just make sure the last category EMPTY_APP_ADJ is kill earlier than the previous..

About the minfree vaule...

I change it to "1536,3072,4096,7680,8960,10240" which actually the same values of "Moderate preset" of autokiller

which is enough to ensure most RAM being use before killing for faster task switching...

=====

Credit

=====

!! Credit goes to Juwe11 for his mighty RAM script~ !!

Backup your RAMscript and remove it to somewhere before install this...

install via CWM, it will put the script into your /etc/inti.d/ that's it, boot and try
[LG Optimus 2x] shpapy:
i just installed it,

i will let u know what are the results,

u are correct, the original script kills the launcher and apps specially XDA :-)
[LG Optimus 2x] antec123:
will try this configuration on auto killer memory seems good m8 to set it to moderate
[LG Optimus 2x] squide:
I'm not sure if other Launcher would have a different OOM value~

I have Autokiller memory optimizer which I paid before...so I can view OOM value easily..

But with this Script... I guess really no task killer needed for our 2X already. :D
[LG Optimus 2x] squide:
so, just edit the minfree value according to the values inside AutoKiller if you find some other setting suits you more :)

but about the adj value... I guess that part is already good enough

now I find my phone already got around 60-90 free RAM at any time...

Multiple games running at the background while web browsing...

and the Browser usually got a higher OOM, which tends to kill earlier than Games..

it is reasonable.. as the WEB you can load again with the same URL..

while the game got killed, you lost the state... android is doing it's work nicely I guess.
[LG Optimus 2x] orlox:
best memory managment script i have tryed is v6supercharger http://xdaforums.com/showthread.php?t=991276

I think its the best of the best.
[LG Optimus 2x] squide:
I tried both V6 and Juwe11's before...

and I manage to be patient enough to follow step by steps...

for installing so many things... and it just put a script in init.d at the end...

And I found it do not contain adj value in it, so I come back to Juwe11's

but anyway, this is your choice... :)
[LG Optimus 2x] pa.pn2:
thanks for that script

just a quick question

would this script also work on a sgs2, running oxygen aosp stock rom?
[LG Optimus 2x] squide:
same as Original Juwe11's version.

it was suppose to work on any ROM which support init.d

but the values may need some tweaking accordingly.
[LG Optimus 2x] shpapy:
Sorry to let you down. But the results are the same......
[LG Optimus 2x] Topogigi:
adj values are in /data/SuperChargerAdj while minfree values are in /data/SuperChargerMinfree.

it's just a script in init.d at the end, you only need to follow it step by step... :D
[LG Optimus 2x] antec123:
i set the preset to moderate and get about 126-128mb on free ram pretty impressive and the stock browser don't get close so quickly nice! i use v10e ESA and neoblaze kernel
[LG Optimus 2x] _Vegas:
Works on CM7?
[LG Optimus 2x] squide:
it should work on all ROM supporting init.d

in case you don't like it, go to /etc/init.d to remove the script and reboot.

it wont modify your file system..

it just override some system value on boot.

if you removes the script.. your phone would back to the state before you install this.

so, just try see if u like, if not, delete it, reboot, that's it.
[LG Optimus 2x] rasmusx:
Works really nicely on CM7 nightly.

Sent from my Optimus 2X
[LG Optimus 2x] waynefox:
Bit of a Dumb question but my phone still has the Stock rom and doesn't have the init.d Folder

if I created /system/etc/init.d and copied the script into that would this work?
[LG Optimus 2x] TrymHansen:
Sorry, no. You need a custom rom of some sort to get init.d support.
[LG Optimus 2x] squide:
You need a Custom Kernel supporting init.d to be more accurate. :)

and NeoBlaze is a good one to try with.

if you really need to keep your stock ROM..

First of all you still need to root your phone

Install ROM manager from market

flash the Clockworkmod via ROM manager

install NeoBlaze Kernel, then you're ready.

if warranty is your concern, take a look to the Nvflash thread..

O2X is ALMOST unbrickable, almost. :)
[LG Optimus 2x] TrymHansen:
I'm pretty sure that won't work. You need ROM-support as well. (A Ramdisk script which starts the init.d. thing to be even more accurate.) Feel free to prove me wrong.
[LG Optimus 2x] djmcnz:
Ramdisk is a part of the kernel, so if you bung a kernel that supports init.d on (any) rom it'll run what's in there assuming it's eXecutable.

You can do it on the stock rom even, as long as you have a init.d kernel (and create the entries in ../etc/init.d/).

Although I can't "prove" this to you at the moment... ;)
[LG Optimus 2x] Topogigi:
Not with anykernel updater. And HP and Neoblaze kernels use anykernel updater. You'll stick with the ramdisk of your previous kernel.
[LG Optimus 2x] TrymHansen:
If you say it is so, I'll believe you.

The reason I stated the above is that we went through this exact thing regarding the HorsePower-kernel the other day. People installed it on GR4, and init.d didn't work.

Turned out that unless GR4 had been baked with a custom kernel to begin with, init.d wouldn't work even if you installed a kernel that supported it. The difference between the versions was a missing line in init.rc.

So at least in that case, installing a init.d capable kernel was not enough. Why it would be different on pure stock than on GR4 I don't know.
[LG Optimus 2x] djmcnz:
Well, strictly speaking that process replaces part of the kernel. Of course if you do that you don't really have the same kernel.

Perhaps I should have said: if you use a compatible kernel and don't make it incompatible in the process it will work... But that seems a bit redundant... :)
[LG Optimus 2x] djmcnz:
Ahh, I see. Although I'm not familiar with that case I suspect I know what happened and it relates to Topogigi's post above.

My explanation:

Paul didn't add init.d support to stock kernel

He did add it to custom kernel

When people updated from stock to HPK the got the unmodified ramdisk (i.e. overwriting init.d support)

When people updated from custom to HPK the got the modified ramdisk

Whatever update method they were using pulled the entire ramdisk from the pre-existing kernel, overwriting the one supplied with HPK.

And yes, the ramdisk is related to, but not part of the "rom" (simply because it's common to distinguish between the two) but it is in the boot.img that can be optionally (and quite normally) distributed with a "rom".

However, the two are not bound together.

Clear as mud! ;)
[LG Optimus 2x] TrymHansen:
Yes, this is what happens. You (both) cleared up one thing for me though. (The other day I tried to figure out a dependable method of finding out if an app is running on a system with working init.d.) I read up on the Android boot process, and the article I read stated that the init.rc which is actually executed by init is supposed to be merge of a script from the ramdisk (which you correctly state is inflated from the boot image) and a script from the ROM, in other words just a file in /system/(..somewhere..). This seems to be false. (Or perhaps this implementation doesn't do it, it's the kernels responsibility to do the merging before calling init.) I also had no idea that installing a kernel could keep an old ramdisk, which also led me to believe that the script responsible for starting init.d (a "start sysinit-line" in init.rc I believe) would come from the ROM. That's cleared up now.

While I have your attention djmcnz, do you know of a better way to detect working init.d? Currently I just look for a line containing "start sysinit" in init.rc. It isn't there in CM7, so I detect that another way. Is there some common thing I could look for? A process which otherwise wouldn't be running perhaps?
[LG Optimus 2x] Topogigi:
There is no ramdisk in HPK. Anykernel updater (google for it) simply takes the previous ramdisk and mixes it with the kernel to generate a boot.img on the fly. This happens when you flash the update.
[LG Optimus 2x] djmcnz:
In that case then I would claim HPK as it's distributed doesn't independently support init.d, it needs to inherit it.

Back to my original point, if a kernel (boot.img) supports init.d and you don't swap this out, then it will execute init.d on any rom.

We're both making subtly different points, both are accurate... :)
[LG Optimus 2x] Topogigi:
Yes, the one is the symptom and the other is what causes it.
[LG Optimus 2x] djmcnz:
I've not looked at their 7.1 kernel yet but what are you currently using to detect in CM?

Pretty much they must be executing "run-parts" somewhere to parse all of the scripts in the init.d directory (default *nix behaviour requires you to call each script explicitly which is unfeasible in an implementation like this).

So I'd look for that string ("run-parts") on the same line as "init.d" in init.rc.

Is it there? If not they're probably calling a custom wrapper (although I can't think of a reason for that), you could replace that call with the appropriate run-parts command if necessary - it will work the same.
[LG Optimus 2x] Topogigi:
Yes I definately agree. Checking for run-parts command existence should be the best way to go. Calling the service sysinit is a common heritance from Unix SysV, and it is generally adopted by the majority of the developers, but you can call that service with any other name and it will work anyway, provided that a wrapper takes care of executing the scripts.
[LG Optimus 2x] 719rock:
so GR4 can't supports this script:p
[LG Optimus 2x] TrymHansen:
I just now downloaded a prebake to see what it contains, and as far as I can tell, init.d should work.

The only case in which it doesn't work is if GR4 has been baked in the kitchen with the stock kernel.

All other cases should work. No guarantees though.

---------- Post added at 04:01 AM ---------- Previous post was at 03:07 AM ----------

Just an ugly hack which detects cm7 itself (it sets some properties the others don't, puts some files in different locations), and if found simply assumes it has working init.d. It works, but I don't like it.

Nope. Can't find either run-parts or even init.d even mentioned in the CM7 ramdisk init-scripts (or stock-based for that matter). (That would have been too easy, was the first thing I looked for.)

The existence of the run-parts binary doesn't mean it gets run at startup, just like the presence of the init.d-directory doesn't mean it's used.

On the surface it looks like CM7 is so different from stock there's no common thing I can look for. I need to check for this OR that anyway, in which case I'll just keep my current implementation. (I may have the app put a script in init.d which sets a property, and let the app check for that property. Seems to be the most accurate way, but requires a one-time reboot after app-installation, which is not ideal.)

Thanks for the replies, both of you, I learned something.
[LG Optimus 2x] Topogigi:
Yes, I meant in init.rc obviously
[LG Optimus 2x] TrymHansen:
Ah, ok, I figured you already knew it wouldn't be there (since you already know the contents of init.rc and init.tegra.rc for your ROMs/kernels), so thought you had to mean something else. Anyway, thanks.
[LG Optimus 2x] squide:
after a few days of usage..

so far so good, never need a task killer..

never got my launcher got killed

quite smooth daily operation..

and without killing anything manually..

my last fully charged battery manage to last 24 hr with medium usage.
[LG Optimus 2x] squide:
without killing any apps manually...

and it's about time to change my battery :)

Running NeoBlaze Kernel, scaling 389-1100, UV 50mV with PimpMyCPU save as Boot

ROM: Topogigi's 1.6+ 1.7SP1 with the RAM script on OP..

Background data ON, 3G all the time

Mild Usage during my day off :)
[LG Optimus 2x] vadonka:
i decided to continue developement of this script

here is what i made:

21.11.2011

- Updated LMK values

- add internet speed tweaks, updated vm tweak section, added misc kernel tweaks

- add battery and micro sd tweak

25.11.2011

- Remove disable normalized sleeper (its a bad thing more than a good)

- add filesystem and mount option tweak

- adjust LMK parameters

- adjust battery tweak parameters

- adjust VM management tweak parameters

- remove microsd tweak, merged to the filesystem tweak section

- adjustable parameters

you can download my script from here or from my signature link.
[LG Optimus 2x] _Vegas:
Thx!~

testing
[LG Optimus 2x] SREEPRAJAY:
Hiii, I see this work is in a note format. How to insert it into the init.d?

Will this work on Horse Power Kernel SR 1 and Topo SP3? Please advise as i am a noob in such things
[LG Optimus 2x] vadonka:
just right click and save as.
[LG Optimus 2x] SREEPRAJAY:
right click and save as:"file name"?

will saving as a note file and inserting into the init.d folder work?

can you please write the procedure? wILL IT WORK ON HORSE POWER KERNEL Stable Release 1/2?

Thanks in advance
[LG Optimus 2x] vadonka:
right click/save as

you can leave the file default name: S99tweak

copy to /system/etc/init.d

set the correct permission and reboot.

it will work with any kernel, but be aware, some kernel using hardcoded memory management and cpu scheduler. in that case modify this script at the parameters section and disable the vm and the cpu scheduler tweak.
[LG Optimus 2x] SREEPRAJAY:
Can you please check the HP and let us know...as a noob i am not aware if there are any hardcore memory management and CPU scheduler...can you do this? It will be a great obligation....

http://xdaforums.com/showthread.php?t=1295486

Thanks once again
[LG Optimus 2x] yukkio:
Hoho +3500 points on second quadrant test :) Thanks dude.

BR.
[LG Optimus 2x] vadonka:
HP kernel have io scheduler, almost identical what i used, so if you let this script doing the scheduling functions it will be not much different that the kernel hardcoded function, but you can disabled and see what happened, do an antutu benchmark or quadrant test.

i use this settings together with swiftextreme hoc-powersave kernel and working great, antutu benchmark give me ~7400 point.

this is far above than SGS2 or even the galaxy nexus. the only device what is beat this the asus transformer prime tablet, but tprime have quad core cpu so i dont be so surprise :)

i made up a cwm install zip for this script: you can download from here
[LG Optimus 2x] xIceCream:
Which kind of ROMs does ur .zip files support ?

CM, or official 2.3 ? ext 3 or 4 ?

sry. ima noob :9
[LG Optimus 2x] vadonka:
not rom related, this is for CWM version > 4.x

same as the original update.zip in the first post
[LG Optimus 2x] xIceCream:
but installing this will make the ROm faster ? o.O
[LG Optimus 2x] vadonka:
minor update:

28.11.2011	- integrated auto kernel version check

i noticed that swiftextreme kernel hardcoded vm and cpu tweaks may be interfered with this script settings, so i decided that integrate a method what is check the running kernel version and override this four parameters below and disabled it.

if you running a custom kernel and experienced that the phone running better, or the battery live longer with this four parameters disabled, let me know (i need the output of the "uname -r" command) and i will integrate more kernel version to the check.

VMTWEAK=off

KTWEAK=off

CPUTWEAK=off

BATTWEAK=off

update in my sig.

i have 2 day 10 hour running time from battery (OC to 1.5GHZ) and i still have 15% cap. level, so i definetly going into the right path :)
[LG Optimus 2x] vadonka:
thanks for the testing :)
[LG Optimus 2x] yukkio:
Sorry dude, I had a older version (before 25 nov) and my phone wasn't fast like without it. So I decided keep original Juwe11's script.

Last kang + vorkkernel

BR.
[LG Optimus 2x] vadonka:
you can change many options, and some custom kernels may be interfered with some settings. you can see the details some of my earlyer post. vorkkernel may be one of them, try to disable this four options what i mentioned before. if the phone will running faster let me know.

btw here is an update:

28.11.2011

- 3G signal, tcp/ip buffer size tweak

- many build prop tweak, details in system tweaks section

- overall script on/off property

this is my two latest battery uptime:

i cant reach more with my daily basis, but i think this is well enough :)

WARNING: if you decide that using this script make sure that remove any other init script from the init.d folder!
[LG Optimus 2x] vadonka:
last update today :)

- minor description update

- LMK common mode switch

- LMK values extended with ultimate mode (it is for emergency only! this will help that running some very aggressive memory eater app)

somebody who is using vorkkernel please post the output of the "uname -r" command. i will add an except for this kernel too.
[LG Optimus 2x] Craxx:
Hy vadonka,

when this is your site http://www.donka.hu please check it. IT IS ALL OPEN EVEN THE SSL KEYS !!!!!!!!!!!!!!!!!!!

.....if not forget it;)
[LG Optimus 2x] vadonka:
thx for the report, i will send an email to my provider that disable directory indexes.
[LG Optimus 2x] Striatum_bdr:
Hi,

I've installed the script and I'll let you know if issues occur.

$ export PATH=/data/local/bin:$PATH

$ uname -r

2.6.32.9-HP_2x_Xtreme_SR2

$

Thanks!

(I evidently removed minfree and 999switch files from power pack 7)

Edit: boot process is smoother than power pack where boot animation was sluggish, even freezed fir a couple of second. Here, nothing comparable.
[LG Optimus 2x] vadonka:
minor update:

29.11.2011

- update kernel auto detect rutin: do an exempt for SwiftExtreme and HP Extreme kernel, that force disable some tweaks.

now working fine with stock, swiftextreme and hp extreme kernel.

make sure you dont use any other memory management script and dont use taskkiller app.
[LG Optimus 2x] sephiroth76:
Thanks for the script vadonka!

Anyway... I've install your script and I observed that low memory killer is working,not sure other is working or not.

But as for build.prop,I cannot see extra line in system/build.prop as edited in your script?!Is that normal?

Currently using Gr5 ROM with HP SR2.
[LG Optimus 2x] vadonka:
yes, its normal. i was using setprop function what is override build.prop parameters on the fly, no need to modify the build.prop file. all in one in this script, if you disable the main script with the first parameter then you have the stock settings. no need to modify any other files, its the point :)
[LG Optimus 2x] jaspi72:
and where i can find this updated stuff?

edit: found..

i have problem can i use gemini autorun manager with this?
[LG Optimus 2x] vadonka:
you can find it in my signature
[LG Optimus 2x] jaspi72:
Can i use gemini autorun manager with this?

I need to get rid stupid apps autoruns, like hotmail or mp3 downloader.

With gemini app manager i can set not allways needet apps boot or some other stuff autorun off
[LG Optimus 2x] sephiroth76:
Thanks again vadonka!
[LG Optimus 2x] vadonka:
yes, autorun manager working fine together with this script.
[LG Optimus 2x] vadonka:
minor update: added ironkernel to the excluded kernels.
[LG Optimus 2x] KillerbeeNL:
deleted all init.d files except bpp from folder and installed zip in CWM and after reboot a faster bootanimation and tested Antutu benchmark score is 5334

this is with HP RC9 and stock/rooted V20L

Is this compatible ? scores look okay to me without OC :D

thanks
[LG Optimus 2x] vadonka:
minor update:

- disable filesystem and mount option tweak by default for safety reason (not working with all filesystem, so use with caution)

if anything goes wrong (bootloop or stuck at lg logo) here is a remover update for CWM

http://www.donka.hu/android/init_remover.zip

remember you can always enter to the recovery mode, just press and hold the "power" button and the "volume down" key together and wait for the second lg logo, then release these buttons. just for the record :)
[LG Optimus 2x] Craxx:
Really great Script, Thank you very much, Great job !!
[LG Optimus 2x] otonvm:
Just a quick question because I couldn't find any answer online (probably because it's not really that important): what is the difference between setprop and build.prop values?

I suppose build.prop get's read first and has effect before init.d is executed but I could be wrong.

Anyway, thanks for the tweaks!
[LG Optimus 2x] jaspi72:
Donka.hu is forbitten?
[LG Optimus 2x] vadonka:
setprop will override build.prop values, but the results is same.

---------- Post added at 07:44 AM ---------- Previous post was at 07:43 AM ----------

just the directory listing, hotlink is working