yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] pikachu01:
After some investigation about Android's OOM groupings, I've found a few things:

1. It is true that ActivityManagerServices is now using it's own values after this change:

https://github.com/CyanogenMod/andr...608423b721e0153f37bfd5eba78fcd2489562d#L3R126

2. Any LMK scripts you're using now for ICS/JB will require services.jar hack as the values are embedded and calculated with a specific formula according to screen size or memory (depending on which ratio is greater).

3. Only Cyanogenmod ROMs are affected by this change. Samsung ICS ROMs (from my Galaxy S2 still adheres to build.prop values and minfree values that are set). Yes, I tested this with the Linux minfrees being low and Android OOM values that are high. Apps will get shafted to the background to make way for more memory if free memory is less than 100MB (I'm using 100MB LMK).

4. I only realized this now as I've never used Cyanogenmod in my phones before this. I'm currently using CM10 on my Galaxy S and Stock ICS Samsung on my Galaxy SII.

5. Hacking the services.jar only corrects the ADJ values. The MEM values are always calculated on the fly when booting the phone by the Android framework. Hence you'll get a LMK mismatch between Android and Linux LMK if you're using a custom LMK by yourself, even with hacking the services.jar.

6. I'll be churning out some new LMK values. As it is, LMK values are only suitable to be running on Gingerbread devices and below or where manufacturers did not include this change. An example is Samsung phones currently running ICS.

7. I don't know if Samsung with stock Jelly Bean has the change or not. If someone is handy with scripts or ADB, you can help check this out for me.
[Android Software/Hacking General [Developers Only]] Kurre:
Doesn't that commit come from AOSP since it's committed by Dianne Hackborn who is part of the android development department (if I'm correct?). So that change would affect all AOSP based roms?

One way to mess around with oom values is to change oom_adj value in /proc/`pidof something`/ and setting it's chmod to 100 afterwards (to prevent it been changed back by the system). But this probably messes around the OOM groupings etc, so that isn't ideal workaround (mostly to make your launcher harder to kill) ?

I use hacked services.jar so I don't have experience of using that workaround..

Sent from my slimbeaned GNex :)
[Android Software/Hacking General [Developers Only]] pikachu01:
Yeah. It came from AOSP, hence it affects all Nexus based phones as well as AOSP based OSes like CM/AOKP etc. I'm not sure if it affects Samsung stock Jelly Bean or other phones like Sony Xperia ICS/ Asus/ HTC ICS and JB yet.

The OOM values that you're talking about is the process OOM value. The OOM value you're setting in Android's framework is a reference OOM value in which when it hits that Memory threshold, all processes on that OOM value are victims that can be killed.

You can make your launcher harder to kill, but what's the point of keeping launcher in memory if your app (such as games) require a lot more memory and your launcher won't give it up? Good OOM groupings should take into account of killing the launcher first before killing services/perceptible apps. You wouldn't want your alarms killed before my launcher right?
[Android Software/Hacking General [Developers Only]] Kurre:
Yeah, exactly what I thought. That's hard to know if it affects all OEM ICS/JB versions without going through source code for all of these. Or well one could just try traditional ways to do with and look if it works.. :)

Yes of course I want my launcher to be killed if needed. That's why it isn't bulletproof..only harder-to-kill or diehard (depends on my mood, which one I'll choose during the process) :silly: But without that I have been suffering from constant redraws even while "normally" using my phone..like browsing, tapatalking, etc.

So, if I'll do: "echo "1" > /proc/`pidof com.some.launcher`/oom_adj", would it have a exactly same affect as hacking the services.jar? Because when I'll select "Diehard" launcher while hacking it, OOM priority will be "1" also. I have been checking those values/oom groupings with Auto Memory Manager. So at least they have same priority value, but is it anyway "same" result?

And I haven't lost any alarms so far and games also run quite nicely. So, for now on, I'll stick with it :D

PS. Still in learning process with these things...This thread among others have been great fun and educational to read..over a year now.. :D
[Android Software/Hacking General [Developers Only]] pikachu01:
Yeah, doing a oom_adj is basically the same as hacking the services.jar (but the effect is localized to only that process that you've echoed to.

It's easy to know if it affects the stock ICS/JB (non AOSP). Just see the minfree values when you're not applying any LMK scripts. The values should be some values that are not a multiplication of 1024 (as the values are calculated based on Total Available RAM multiplied and divided a few times with some pre-defined numbers that will end up as some number that won't be multiples of 1024).
[Android Software/Hacking General [Developers Only]] .:Crack:.:
So there's nothing I can do?

Could you try this devil kernel?

http://rootaxbox.no-ip.org/derteufe....5_Jelly_Helly_i9000_CFS_BLN_CMC_20121122.zip
[Android Software/Hacking General [Developers Only]] dante10:
hi pikachu01...does the remount script for i9100 works for i9100g?
[Android Software/Hacking General [Developers Only]] Steven6489:
Anyone use ThunderBolt! v2.9.0 in JB XXLSJ NeatRomLite v4.0? Any improvement?
[Android Software/Hacking General [Developers Only]] kaluoshi:
so man i'm a little bit confused also cause i read your replies from the phone quickly. i'm working on Stock Image of 4.2.1 (galaxy nexus), do i need service.jar patched? or is enough to use LMK addon? thanks! :thumbup:
[Android Software/Hacking General [Developers Only]] pikachu01:
You can try echoing values to see if it sticks. Besides that, try asking the kernel dev to fix it?
[Android Software/Hacking General [Developers Only]] pikachu01:
Yeah, it's compatible. Both uses the same position layout.
[Android Software/Hacking General [Developers Only]] pikachu01:
It works with Galaxy Note 2 with awesome improvements in performance and battery life. Should work without problems for I 9100 JB as well.
[Android Software/Hacking General [Developers Only]] pikachu01:
What it means is, you should not use patched service.jar or LMK. You should use stock LMK already calculated on the fly, unless you want mismatching MEM values on your Android OOM.
[Android Software/Hacking General [Developers Only]] pikachu01:
I think I might have made a mistake somewhere, but there should be good news with this mistake :P

Hold on tight :)
[Android Software/Hacking General [Developers Only]] .:Crack:.:
Already did that and wanted to post it hours ago but my phone crashed and I went to sleep :D

Echoing works fine. Could your tell me the formula so I can calculate it manually? I don't understand the formula of the script. What's totmem and why do we multiplicate our mem ( for me ~403[MB] * 1024 = 412452) once more with 1024? Shmax is something over 316 million. That seems insanely high, doesn't it?
[Android Software/Hacking General [Developers Only]] pikachu01:
Bad news :(

OSes with the OOM change should be left without any LMK hacks. This is because, changing the LMK will result in LMK mismatches. Right now, the LMK is generated on the fly according to the Total Available Memory.

Hence, if you're using AOSP ICS/JB or its derivatives, you should not install any LMK hacks nor services.jar to get the best in performance.

You can however still hack the MAX_HIDDEN_APPS to increase the number of apps you can stash in the HIDDEN_APP OOM category though in services.jar. Any more than that, you'll get a half baked LMK setting.
[Android Software/Hacking General [Developers Only]] pikachu01:
The formula is this:

mem is the Total Available Memory in KB.

totmem is the Total Available Memory in bytes (which is the format that shmmax parameter accept).

max is 75% of totmem (which should be the recommended ratio. Anything from 65-80 is good).

all is 80% of totmem calculated in pages (hence why it is divided by page size which is 4096 by default Linux. Recommended ratio should be about 75-80 IMHO)
[Android Software/Hacking General [Developers Only]] .:Crack:.:
Yeah, I figured that in the meanwhile, too :P thank you.

The page size for me is 4096 but I know that it was set to 1024 in previous versions of thunderbolt. What do you recommend? Also the kernel start script has this set for kernel.sem:

Thunderbolt: kernel.sem="250 256000 32 1024"

Devil script: kernel.sem="500 512000 64 2048"

Should I apply the thunderbolt values or leave the kernel 'defaults' ?
[Android Software/Hacking General [Developers Only]] Alberto96:
Can u make this compatible with Android 4.2.1?
[Android Software/Hacking General [Developers Only]] kaluoshi:
Only 1) CWM zip 2.9.0 + 2) Screenstate scaling addon are compatible with ICS/JB (also 4.2.1) but not the LMK as pika is trying to solve it cause to JB's new structure. anyway read the OP at the top of first post, the red lines. keep in mind that LMK is WIP for JB.
[Android Software/Hacking General [Developers Only]] pikachu01:
No. msgmni is not shmni. shmni is page size. msgmni is the message queue parameter.

http://www.unix.com/man-page/all/5/msgmni

The kernel sem should not make much difference if the limit is not reached. :/ You'll not feel much difference.

It's already compatible. The main CWM script and screenstate_scaling should work. The LMK should work if Samsung haven't integrated this commit yet:

https://github.com/CyanogenMod/andr...608423b721e0153f37bfd5eba78fcd2489562d#L3R126
[Android Software/Hacking General [Developers Only]] .:Crack:.:
Oh.. My bad -.-

OK thank you.
[Android Software/Hacking General [Developers Only]] pulak861:
pikachu i would like to use ur tweak in my new rom for xperia sola.. would u give permission.. i would provide proper credits to u and give a link back to ur thread.. thanx...
[Android Software/Hacking General [Developers Only]] pikachu01:
Sure. Let me know if you need any support from me :)
[Android Software/Hacking General [Developers Only]] icu64:
OK so I try to flash this on my phone and with every recovery I use it says status 0, how do I fix that?
[Android Software/Hacking General [Developers Only]] pikachu01:
What phone are you on? Might be a updater_binary problem. Try replacing the CWM zip updater_binary in META_INF with a CWM zip that works for you.
[Android Software/Hacking General [Developers Only]] carniman78:
Pikachu01, if I have my I9000 with AOSP JB 4.2 with Semaphore Kernel 2.8, what is the correct way to install ThunderBolt! scipts? I don't undertand well how to install them
[Android Software/Hacking General [Developers Only]] pulak861:
pika my rom is running great with ur tweaks built in it... thanx for giving me the permission...... i have put ur name in credits with link to this thread.. thanx for granting permission.. heres the link.. post 2....
[Android Software/Hacking General [Developers Only]] pikachu01:
Only the main CWM (ThunderBolt! v2.9.0) is working for AOSP JB 4.2. This is because:

- screenstate_scaling will hang at boot.

- LMK is set automatically by the Android OS. Overriding it will cause the LMK values to mismatch and cause a half-baked LMK to work on your phone.

To install ThunderBolt!, just copy the CWM zip into your SDcard and then install it.

Enable the bolt_scripts that you want like remount/zipalign etc in Script Manager. The detailed installation sequences are in the first post. Let me know at which part you're stuck on.
[Android Software/Hacking General [Developers Only]] carniman78:
Ok, I'll try to install it this afternoon and I'll give you my feedbacks. I was confused because I´m not sure if all the scripts work in JB 4.2.

Thank you for your help.
[Android Software/Hacking General [Developers Only]] ushkakaka:
hi pika need your help. after clearing cache and dalvik in cwn, i installed thunderbolt 2.9.0 and screen state scalling. but upon reboot, i stuck at the 'semaphore' screen

i m using slim bean JB 3.1 (still 4.1.2) and semaphore 2.6s

hoping for your reply
[Android Software/Hacking General [Developers Only]] djb77:
Just a quick question on what would be a good setup for my phone. I'm running a SGS3 4G I9305. Would I be right to assume to go with the main thunderbolt file, libsqlite, screenstate scaling and 100mb lmk?
[Android Software/Hacking General [Developers Only]] Kurre:
Boot to recovery, startup the adb, remove screenstate scout and try again. Dunno how compatible it is nowadays, but it has a history of causing bootloops etc, IIRC?

Main script shouldn't cause any problems.

Ps. I see that you're also participating lazeroid/gameroid thread (other init.d script). So I'd suggest removing those also..try those scripts one by one to see if one of those is causing problems (those might actually clash with tb).

Sent from my slimbeaned GNex :)
[Android Software/Hacking General [Developers Only]] pikachu01:
If you read the BIG RED BOLD text in the first post, you'll notice that screenstate_scaling is not compatible for AOSP/AOKP ROMs. Restore your nandroid backup or delete the screenstate_scaling file using the AROMA File Manager in /system/etc/init.d/.

What ROM are you using? Libsqlite is only compatible with Gingerbread. If you're using AOSP ROMs, you cannot use the screenstate_scaling or LMK (you'll get mismatched LMK).

Yeah, don't install Lazeroid etc as they will cause conflict with ThunderBolt! scripts.
[Android Software/Hacking General [Developers Only]] FitAmp:
My phone has about half a gig of ram (about 430mb usable) which lmk should I try?
[Android Software/Hacking General [Developers Only]] pikachu01:
What OS are you using?

If you're using AOSP based ROM starting from ICS, you should let the OS handle the LMK. This is because, starting ICS, all AOSP ROMs changed the way LMK is handled and it is now calculated on the fly according to your Total Available Memory. Changing it through hacked services.jar and LMK tweaks will result in mismatched LMK values.
[Android Software/Hacking General [Developers Only]] FitAmp:
Gingerbread (2.3.3)
[Android Software/Hacking General [Developers Only]] pikachu01:
Try using the 60/80/100 MB LMK. Try the 100MB LMK first and see how multitasking with it works for you. If you don't like it, go lower. :)
[Android Software/Hacking General [Developers Only]] FitAmp:
Will try now! Thanks :)
[Android Software/Hacking General [Developers Only]] Syntaxer:
Hi, I just wanted to ask if its a problem if I zipaligned apks and I am on CM10? Because some of my apps are corrupted after that :(
[Android Software/Hacking General [Developers Only]] pikachu01:
The apps themselves could be compiled differently and not compatible with being zipaligned. Just install the apps again. I know that Google Apps from GApps pack (Cyanogenmod based) is susceptible to this.
[Android Software/Hacking General [Developers Only]] ushkakaka:
thx bro

---------- Post added at 02:19 PM ---------- Previous post was at 02:18 PM ----------

thx bro
[Android Software/Hacking General [Developers Only]] .:Crack:.:
You're saying Supercharger (with hacked services) is bunk (on Android 4+)?
[Android Software/Hacking General [Developers Only]] pikachu01:
That's true :)

It will result in mismatched LMK as there is no possible way to hack the services.jar to put in exact *_MEM values. It'll be like using the Linux LMK only and only hacking the *_ADJ values while leaving the *_MEM values untouched. The LMK setting is basically half-baked.

This only happens in AOSP ICS and JB. I haven't seen the implementation of JB in Galaxy S2 yet (and I don't have other devices, so I can't comment on them).

If you have a Samsung (or other native device) that has ICS/JB, let me know and I can show you if you're using the "calculated-on-the-fly" LMK and the "old-school" LMK that you don't need to hack the services.jar to set it.

The Galaxy S2 Samsung based ROM is still using the "old-school" LMK even though it's ICS.
[Android Software/Hacking General [Developers Only]] melvinaury:
what abou the gs3 with 4.1.1?
[Android Software/Hacking General [Developers Only]] pikachu01:
Is that a Samsung based ROM? Are you using any LMK tweaks?

If you are not, please provide the output of this file:

/sys/module/lowmemorykiller/parameters/minfree

If you are, please remove the LMK tweaks, and I'll use the output of that file to determine whether or not LMK is calculated on the fly.
[Android Software/Hacking General [Developers Only]] ernestnwanu:
Pikachu, what files would you recommend for a HTC Desire Z on Jelly Bean (around 370 MB of ram)? Would like to try this over the supercharger script..
[Android Software/Hacking General [Developers Only]] melvinaury:
Ok I check and send you the file

---------- Post added at 04:22 PM ---------- Previous post was at 04:22 PM ----------

And right now I don't have any tweek installed
[Android Software/Hacking General [Developers Only]] Kurre:
That isn't a traditional file which you could send..or maybe you could but maybe you don't even try it.. :p

Just go to the terminal emulator or adb shell and run these commands:

su

cat /sys/module/lowmemorykiller/parameters/minfree

And paste result here.

Sent from my slimbeaned GNex :)
[Android Software/Hacking General [Developers Only]] pikachu01:
I assume that you're using an AOSP based ROM. Hence you should be able to install the main CWM (ThunderBolt! CWM v2.9.0.zip). The LMK doesn't work as the ROM itself calculates the OOM/minfree values. Modifying them will cause LMK mismatches on the Linux and Android ones. Screenstate_scaling would also fail to work as it will hang at boot.

I just need the output. You can do that by doing what Kurre mentioned below. Or you can just go to Root Explorer or any file explorer with root access and open the file.
[Android Software/Hacking General [Developers Only]] ernestnwanu:
Yep, CM10 to be more precise. Perfect, thanks! I'll try to apply the main zip file later on and return with feedback.
[Android Software/Hacking General [Developers Only]] spambayes:
Hi Pika,

Good to see that you're still doing all of us such a big service in keeping Thunderbolt upgraded. I finally bit the bullet and left GB behind, skipping ICS along the way and jumped right into JB. :) Using SlimBean 3.1 with Semaphore 2.6.5s at the moment and spent the past few days catching up on the necessary.

So I understand that only the main CWM 2.9.0 is currently compatible with AOSP Roms like CM10 and its derivatives. I disabled all options for stock performance tweaks and flashed Thunderbolt 2.9.0 and rebooted. However, I can't find S91Supercharger either in /etc/init.d or /etc/bolt_scripts. I see the following:

What am I doing wrong?

Thanks.
[Android Software/Hacking General [Developers Only]] pikachu01:
Cool. :) Let me know if you have any problems.

S91SuperCharger is only available in the LMK addons. LMK addons aren't compatible with AOSP ICS/JB. This is because since ICS AOSP (Samsung based ICS still retains this capability), the LMK is calculated on the fly by the ROM. Hence, hacking the Linux LMK will result in a mismatched LMK. Even hacking the services.jar, (which incidentally can only change the *_ADJ values of the Android OOM/LMK values) can't produce straightforward/correct LMK values that you want. Hence it is best left to the ROM itself to calculate the LMK values.
[Android Software/Hacking General [Developers Only]] pikachu01:
Good news!

I've made screenstate_scaling compatible with AOSP/AOKP. Will be releasing the update in a few after some more testing :)
[Android Software/Hacking General [Developers Only]] spambayes:
Ahhh. Thanks. I was so blindly trying to following the Installation Instructions in your OP "Open up Script Manager and launch /etc/init.d/S91Supercharger as Root (The skull icon) and as Boot (The wheel icon)." that I forgot it could be referring to LMK which is of course invalid for AOSP.

My next question would be, how then can I optimize the performance now that tweaking LMK is basically out of reach for AOSP users? I still get launcher redraws from time to time and some UI lags though not on the same level as GB. Seems like there's no way out now that patching services.jar doesn't really do it as well.

Are there any benefits in enabling Start Up Tweaks under Performance in CM10/Slim Bean? I mean things like SD Card Boost (Read Ahead Value) and Kernel controls options like zRAM and samepage merging. Will they help in any way on top of Thunderbolt?

I see some people have really pimped out their setups with Thunderbolt + Supercharger + Superlauncher + other scripts and I really wonder if that's any good at all?

Thanks.
[Android Software/Hacking General [Developers Only]] pikachu01:
You should get launcher redraws as your launcher would be killed to make way for performance. There is no way you can gain performance/memory without making an equivalent exchange. It is good that your launcher was redrawn. It was to make way for performance am I right? :)

As for launcher lags, I'm not getting it after enabling remounts/CFS.

The SDCard ReadAhead is already tweaked to 1MB in ThunderBolt!. You can try enabling ZRAM and KSM, but I don't think Semaphore supports it. Only one particular version does. :/

It's bad to use multiple scripts from different sources. It's like having your pizzas with all toppings in it. Some tweak it some way, and other another. Choose one and if you see something missing from it, request the script/tweak author to add it :)

Know this though, I won't be adding tweaks that are detrimental to the phone e.g. build.prop tweaks that do nothing, loopy smoothness, weird VM settings etc unless you can convince me that the system actually benefits from it.
[Android Software/Hacking General [Developers Only]] shoutokuyaki:
Ur script work sir, in Galaxy Y

But, cwm flashable not work on CWM galaxy young("installation aborted 0 bla bla")...i just extract zip and place to the place:D

Maybe one or two script not work:(, can u make cwm flash work on galaxy young? Hehhe...

Sorry my english bad
[Android Software/Hacking General [Developers Only]] pikachu01:
Try replacing the updater_binary in the META_INF folder with another CWM zip that works for your device. This is because of your CWM version in your phone is older than the current one.
[Android Software/Hacking General [Developers Only]] ernestnwanu:
Quick question: is 4EXT Recovery compatible or just CWM?
[Android Software/Hacking General [Developers Only]] pikachu01:
Never heard of 4EXT, but you're welcomed to try it out to see if it works.