[Script] V6 SuperCharger !! HTK & BulletProof Launchers! FIX MEMORY FOR ALL ANDROIDS!

Discussion in 'Android Hacks and Help' started by zeppelinrox, May 18, 2011.

  1. zeppelinrox
    Offline

    zeppelinrox Premium Member Premium Member Developer

    Joined:
    Jan 15, 2011
    Messages:
    512
    Likes Received:
    0
    Trophy Points:
    0
    [UPDATE 8!] V6 SuperCharger !! HTK & BulletProof Launchers! ALL ANDROID MEMORY FIXES!

    Before you start reading, just know that this is not difficult to implement... it's easy.
    Download a script. Load it. Select what you want. EASY.

    But first, let me link to my method of calibrating the battery without downtime so you can use your phone normally and do it whenever it's convenient.
    It definitely works on Milestone and it seems to work on Droid.
    I think that's a pretty good trick, anyway - it may even work on other phones ;)

    ========================================

    Note: Do this at your own risk, regardless of how little risk there is - since I included UnSuperCharging :)
    ........ Well, do a nandroid anyway, if you like :p

    Requirements:
    1. Rooted Phone
    2. Script Manager or Terminal Emulator to run the script. Stock ROMs can also use SM to load up boot scripts!
    3. Busybox 1.18.2 OR LOWER - 1.18.3 or newer are VERY much a hassle with errors that should NOT be errors!

    Installing/Using:

    1. Download the attached V6_SuperCharger_for_Android.zip and extract the script to your sdcard.
    ... Do NOT run the V6 SuperCharger install script at boot!
    2. Load the script (V6_SuperCharger_for_Android.sh) into Script Manager and select "Run as Root."
    3. Touch the screen for the soft keyboard or slide out the keyboard and get SuperCharged! Just pick an option!
    4. READ the script's output!
    5. Afterwards, READ the html HELP FILE in the root of your SD Card!
    6. Disable "Lock Home in Memory" if your ROM has this option.
    7. Optional: For a quick status check, you can put a Script Manager widget for V6 SuperCharger on you desktop :)

    Cool! - Here is a Visual V6 SuperCharger Installation Tutorial (Screen Caps!) by MalarKeY007 (thanks dude)

    If you are using compcache and have lag or slow down after SuperCharging,
    DISABLE compache, wipe caches and re-enable it.
    Also make sure to uncheck/disable lock home in memory! (and leave it unchecked)

    UPDATED July 21, 2011: - Update 8
    Improved code
    Tweaked Current Status functionality. It will tell you if your current and prior minfrees match but if you apply a setting, it won't update the "prior minfrees" with the values you just installed. It will update the prior minfrees the next time you run the script.

    UPDATED July 18, 2011: - Update 7
    Tweaked Status Checker. Update 6 sometimes gave wrong launcher status :p

    UPDATED July 16, 2011: - Update 6
    Added Second MegaRAM device setting.
    Added installation to system option - for easy use with Terminal Emulator!
    Added UnSuperCharger verification
    Improved status checker. It can sometimes determine if home is locked in memory! If not, it asks you if it is.
    Saves SuperCharger settings! - They are displayed on the main menu if they exist.
    Saves Cust-OOM settings! - Cust-OOM settings get added to the menu!
    Smart Cust-OOMizer - Just try it :)
    Improved the code some more. It's smarter than ever :)
    Improved messages to user. Clearer instructions and errors are given!
    Final attempt to get this to load on boot. Custom ROMs will now get the /data/userinit.sh and /data/99SuperCharger.sh files.
    Easily cook into your rom! Just change the variable (rcpath=) on line 120 to the path of your *rc file!
    1224 lines of code! :eek: :cool:

    UPDATED June 29, 2011: - Update 5
    Removed 2 minute delay from userinit.sh. Sorry, I didn't know that it would pause the boot process on some phones/roms

    UPDATED June 26, 2011: - Update 4
    Fixed issue with error check - commented it out as it would stop the script dead on some roms :p
    Improved Status Checker some more
    Improved the code. The script is much smarter, cleaner and efficient (no more temp files)
    1001 lines of code!

    UPDATED June 25, 2011: - Update 3b
    Pulled earlier Update 3 - fixed minor noticeable errors and one HUGE one that went unnoticed...

    UPDATED June 25, 2011: - Update 3 -PULLED
    Added error check that exits script on any error
    Tweaked OOM groupings/priorities (Froyo is the same as always, Gingerbread now takes into account Perceptible App)
    Improved Status Checker
    ReReFixed!? userinit.sh now used as a launcher for 99SuperCharger - with a 2 minute delay! (This boot script fix HAS to work :p)
    Fixed sysctl error on some phone configurations

    UPDATED June 20, 2011: - Update 2
    Added User Selectable Scrolling Speed!
    Fixed a couple of weird issues that some people had in yesterday's update :p
    ReFixed? Still trying to get the 99SuperCharger boot script to load automatically for everybody... grrrrr...

    UPDATED June 19, 2011: - Update 1
    Added MegaMemory Device setting!
    Fixed formatting for Script Manager update (40 columns)
    Fixed (I hope) boot script not booting on many ROMs (Thanks for the tips, lovethyEVO)
    Fixed long press back button kill (wasn't working)
    Modified OOM groupings/priorities: Nothing breaks... EVER!
    Improved the help html files

    Main points:

    - CUST-OOMIZER! Use your settings without Autokiller Memory Optimizer or Auto Memory Manager!

    - For newer phones with lots of ram, use the 3rd slot to set how much free ram you want.

    - If you have /system/etc/rootfs/init.mapphone_umts.rc, it makes a backup and edits that single file. This is nice and tidy.
    ... Thank to kabaldan for pointing out the importance of certain things.

    - Most Custom ROMs - If you have a /system/etc/init.d folder, it creates 99SuperCharger in there and edits /data/local.prop (20 entries added for adjusting priorities and groupings). You shouldn't need to configure anything else.

    - Stock ROMs - If you have neither, it creates /data/99SuperCharger.sh which you can load up on boot (run as root) with Script Manager. The OOM groupings work as well since it happens on boot in local.prop (20 entries added) :D

    Note: For some reason, the minfree levels do not stick on some Custom ROMs. I don't know why this is. Maybe a bug in GingerBread?
    ........ If this happens to you, use Script Manager to load /system/etc/init.d/99SuperCharger "on boot" and "run as root"

    In case of any error, you will find a related help file in the root of your SD card.
    So... I think this covers ANY Android ROM :)

    It also determines if you're using Script Manager and gives appropriate information/tips/help files depending on what other factors are present.

    The above is really ALL YOU NEED TO KNOW.
    The V6 SuperCharger script does everything!

    Anything below is extra info!

    It's just a single file... 806 lines (807 if you count the blank line at the end LOL)


    So... What's it do?

    It makes your phone FAST... super snappy with better multitasking!

    If you read between the red lines below (History Parts 1-3), you'll see that at first it was only about minfrees and launcher redraw.
    But after installing GingerBread, I saw that it needed more work than Froyo LOL.
    Groupings were ALL MESSED UP and made NO SENSE to me whatsoever...

    So I figured out how to group them more like CM6 (Froyo) but that still wasn't good enough...

    I further rearranged the OOM Groupings and Priorites and lowmemorykiller values for a...
    COMPLETE MEMORY MANAGEMENT FIX!

    That's basically what this is :D

    Faster than ever, no launcher redraws, multitasking is better... why?
    Because it works with the lowmemorykiller and letting it work the way it's meant to work.

    Also, because of the rearrangement, it works the same on all roms!
    The problem with using minfree tweakers like AMM or AKMO is that it doesn't work the same on all roms.
    Secondary apps may be in slot 3 on some roms but in slot 5 in others!
    That's why you hear people comment "I tried AKMO but it didn't do anything..."
    Most likely it didn't do anything because the apps weren't sitting where they were expected to be.


    Upon installation, V6 SuperCharger will first clean up any previous supercharging so none of your files get cluttered.
    But if you toggle between Hard To Kill and BulletProof launchers, the memory adjustments aren't affected.

    So you can leave your minfrees at stock/default settings and apply the Hard To Kill Launcher and still get the OOM Grouping/Priority fixes.

    So if you love your ROMs memory settings, just try the HTK Launcher/OOM Fix... you won't regret it :)

    It's pretty awesome :D

    Here are some snaps....

    Before...
    [​IMG] [​IMG]
    After...
    [​IMG] [​IMG] [​IMG]
    During....
    [​IMG] [​IMG] [​IMG]

    Say Buh Bye to AKMO or any app that has to load on start up to change minfrees...

    So did you notice the difference in groupings?

    By default, CM7 has nearly all the apps in slot 5 and the launcher in slot 3.
    Slightly aggressive settings will kill any chance of multitasking in that situation.

    After SuperCharging, the apps get moved to slot 3 while the launcher is in slot 2 but the most important item in slot 2.

    I've read, "oh you don't need to run any scripts for memory management..."
    Well that's not true.
    Playing with minfree values is one thing... it's playing with minfree levels... it's not really memory management...

    Look at the pics above... now THAT's memory management...

    If you look below the red line... that's how it all started... good background info in case you're wondering what the hell I'm talking about.

    So whatever is between the red lines, don't worry if you don't understand it... the script does everything!

    ==================================================================================

    So... recently I came across/figured out some pretty neat stuff to make my Milestone run incredibly well.
    Fast, Stable, and Smooth. FSS... heh... my Milestone used to make me say FFS too often... lol

    In Part 2, you will find a way to make your launcher bulletproof!
    What's that mean? No more screen redraws! AT ALL - I'm pretty sure :)

    History Part 1. How To Control Android's Memory Manager via minfree

    This revolves around Android's built-in memory manager/task killer.
    I had been using Auto Memory Manager (AMM) with great results. AutoKiller Memory Optimizer (AKMO) had worked just as well.

    These are NOT taskillers! (And neither is my SuperCharger :D)
    They tweak Android's native memory management system by editing /sys/module/lowmemorykiller/parameters/minfree
    This is a "dynamic" file that gets created on boot.
    There is an in-depth thread that you can read right here on XDA: How to configure Android's *internal* taskkiller

    Android puts each running app into 1 of 6 Out Of Memory (OOM) groups based on their priority.
    FOREGROUND_APP, VISIBLE_APP, SECONDARY_SERVER, HIDDEN_APP, CONTENT_PROVIDER, and EMPTY_APP.

    Additional Info: You can find each app's priority and OOM.
    ....................... In AMM, Press Menu > Running Processes > Group by OOM grouping.
    ....................... Expand each group and see what apps are included and each app's priority level. (Higher numbers get killed first!)
    ....................... If you tap on an app, you can get additional info. Tip: Check and see what's included with android.process.acore ;)

    The default minfree values ("kill thresholds") for each OOM group are, as far as I can tell: 6, 8, 16, 20, 22 and 24 mb. (CyanogenMod 6.1.2)
    This means that: when free memory lowers to 24 mb, EMPTY_APPS get killed; at 22 mb free ram, CONTENT_PROVIDER apps get killed; and so on...

    Now, because the Milestone has only 256 mb of memory, I found these numbers too low, especially the 3rd one.
    Basically, with those settings, you will usually be sitting with only 20 - 25 mb of ram.
    Possibly less. Basically, it's the 3rd number (16) + 5. That's your free memory.
    And my phone just chokes when it has that little ram available. Lag, home screen redrawing, the launcher getting killed.... ugh....

    After extensive fiddling around, I've come to the conclusion that setting the third slot to about 25mb works great.
    No home screen redraws while not being too aggressive on secondary/background apps while having about 30-35mb free all the time :)

    BTW, free ram is not wasted. Android will use that memory to cache the file system and this speeds things up. See this informative post.

    [​IMG] [​IMG] [​IMG]

    My other key settings were:
    VM Heap Size = 48 mb.
    Home Locked in Memory (not anymore due to my OOM Grouping Fix)
    JIT enabled - You can try it on or off and decide what you like better (JIT uses some extra memory but makes the CPU more efficient)
    Overclocked to 1100mhz@64 vsel.

    About VM Heap size. 40 mb should be enough.
    Actually, to prevent your launcher from splitting into 2 virtual machines, you should make it at around 40 mb.
    I'm no expert about it, but that is the experience of others. (I've never tried it at 32 mb or below :p)

    History Part 2. How To Control Your Launcher Redraws by Making It Bulletproof!

    Most of you know about CM's "Lock Home In Memory" setting and how we would still get screen redraws after enabling it.
    My suggested AMM settings above should be enough prevent that. You should hardly ever get screen redraws anymore.
    But some people were still getting them.

    I tried increasing the appropriate priority (for android.process.acore - which includes com.android.launcher) in AMM but the setting wouldn't "stick"
    Android would revert it back to where it was - in the Visible App group with a priority of 1.
    I had seen how foreground apps had a priority of 0 or -12 or -16 and I came up with a permanent solution - "The Bulletproof Launcher"

    Here's how you can have a Bulletproof Launcher!

    The line "ro.HOME_APP_ADJ=1" in /data/local.prop also keeps home in memory - it has the same effect as CM's "Lock Home In Memory".
    So in light of what I was seeing in AMM, I have changed it to 0 so it now reads:
    ro.HOME_APP_ADJ=0
    (blank line)

    Note: If there isn't a blank line at the end, the ro.HOME_APP_ADJ entry gets deleted.

    If you do this and reboot, AMM may still show that android.process.acore (or whereever your launcher is) with a priority of 1
    If that's the case, disabled CM's setting to lock home in memory.
    Now, if you go back to AMM, you should see that android.process.acore is now a foreground app with a priority of 0... BOOYA!

    Notes: Obviously, CM's "Lock Home In Memory" overrides the setting in local.prop.
    .......... CM will set the priority back to 1 after local.prop gives a priority of 0.
    .......... That's why CM's setting has to be disabled - so that the local.prop setting will "stick"
    .......... Gaming Tip - You can use CM's lock home in memory as a "Safety Lock" - to toggle your launcher from Bulletproof (0) to Killable (1)
    ............................. If having problems with a game, put the "Safety Lock" on so the launcher is "killable" so android can free up some extra ram.

    Note that BulletProofing is NO LONGER RECOMMENDED! The Hard To Kill Launcher is the PERFECT SOLUTION!

    History Part 3. Blah Blah Blah...

    Interesting Notes: I had installed the Telus Froyo Update yesterday (03/25/11) and still have it installed.
    .......................... Only now did I think to look at the minfree values :p
    .......................... 8, 12, 24, 28, 32, 32 <--- Telus Froyo. I'm a little shocked by the 3rd slot, 24mb?! :eek:
    .......................... 6, 8, 24, 26, 28, 30 <----- See, I'm not crazy! Telus Froyo values are very similar to my Balanced Settings :cool:
    .......................... In comparison, my Balanced script keeps your foreground apps alive longer, same free ram & more friendly to background apps!
    .......................... For completeness:
    .......................... 6, 8, 16, 20, 22, 24 <---- CM6 (Froyo)
    .......................... 6, 8, 12, 16, 24, 32 <---- CM7 (Gingerbread)
    .......................... 8, 12, 16, 24, 28, 32 <--- Google's Gingbread values, according to this.

    ==================================================================================

    In the works...

    You can choose a text colour as well as scrolling speed...

    [​IMG] [​IMG] [​IMG]
    [​IMG] [​IMG]

    Notes: Minfree changes take effect immediately!
    .......... This means you can switch from Balanced settings to Gaming and back again without rebooting!
    .......... Switching between Hard To Kill and BulletProof Launchers require a reboot to take effect.
    .......... Disable your OS's "Lock Home in Memory" option, if it has it. This takes effect immediately.
    .......... Or use "Lock Home in Memory" as a "Saftey Lock" - to toggle your launcher from "Bulletproof" (0) or HTK (1) to "Weak" (2)
    .......... Note: "Lock Home in Memory" is not 1 with my OOM Grouping/Priority Fixes ;)

    Cool Tip: Sometimes it's difficult to keep a wanted background app alive, such as an SMS app.
    ............. If you're in this situation, check out how to Bulletproof Background Apps!

    Remember: When using scripts, use the SuperUser app to DISABLE SuperUser permissions for AMM!
    ................. It can still monitor your OOM groupings but it can't change your custom settings on boot.
    ................. If you have AKMO installed, disable it's option to Apply Settings at Boot!

    If you are using compcache and have lag or slow down after SuperCharging,
    DISABLE compache, wipe caches and re-enable it.
    Also make sure to uncheck/disable lock home in memory! (and leave it unchecked)
    Last edited: Jul 21, 2011
  2. sonicfreak360
    Offline

    sonicfreak360 New Member

    Joined:
    Aug 19, 2010
    Messages:
    534
    Likes Received:
    0
    Trophy Points:
    0
    Haha, you didn't need to post it here, everyone has already linked it 2 thousand times already! Oh well, glad to see an official post from you, and keep up the epic work!

    Sent from my Droid using Tapatalk
  3. zeppelinrox
    Offline

    zeppelinrox Premium Member Premium Member Developer

    Joined:
    Jan 15, 2011
    Messages:
    512
    Likes Received:
    0
    Trophy Points:
    0
    LOL well I kept saying I'll make a thread here once I cleaned it up a bit...

    At least its more organized now that I removed old gscript info n stuff :p
  4. jstafford1
    Offline

    jstafford1 DF Super Moderator Rescue Squad

    Joined:
    Nov 15, 2009
    Messages:
    9,060
    Likes Received:
    128
    Trophy Points:
    63
    Location:
    Hebron, Oh.
    And its stickied now too ;)

    sent from somewhere...
  5. zeppelinrox
    Offline

    zeppelinrox Premium Member Premium Member Developer

    Joined:
    Jan 15, 2011
    Messages:
    512
    Likes Received:
    0
    Trophy Points:
    0
    :cool: beans :)
  6. zeppelinrox
    Offline

    zeppelinrox Premium Member Premium Member Developer

    Joined:
    Jan 15, 2011
    Messages:
    512
    Likes Received:
    0
    Trophy Points:
    0
    jstafford1: Well I just tested it and it actually made a new /data/local.prop

    So now that you made a /data/local.prop it will write there for sure.

    But the question is... will your ROM actually use it...

    You'd have to run it, check local.prop and see 20 entries made by the script.

    Reboot.

    Load the script and see if you launcher is Hard To Kill... if it is then it worked.
  7. jstafford1
    Offline

    jstafford1 DF Super Moderator Rescue Squad

    Joined:
    Nov 15, 2009
    Messages:
    9,060
    Likes Received:
    128
    Trophy Points:
    63
    Location:
    Hebron, Oh.
    Maybe I should read the instructions and run in root lol

    Worked this time. Thanks!!!!!!

    sent from somewhere...
  8. zeppelinrox
    Offline

    zeppelinrox Premium Member Premium Member Developer

    Joined:
    Jan 15, 2011
    Messages:
    512
    Likes Received:
    0
    Trophy Points:
    0
    Omg lol

    Sent from my Milestone Powered by my V6 SuperCharger
  9. jstafford1
    Offline

    jstafford1 DF Super Moderator Rescue Squad

    Joined:
    Nov 15, 2009
    Messages:
    9,060
    Likes Received:
    128
    Trophy Points:
    63
    Location:
    Hebron, Oh.
    Yeah yeah yeah....I'm at work and glossed over it. :p

    sent from somewhere...
  10. syndicate0017
    Offline

    syndicate0017 Well-Known Member

    Joined:
    Feb 2, 2011
    Messages:
    2,010
    Likes Received:
    48
    Trophy Points:
    48
    Ran this script on Cyanogen 7.0.3, but I didn't see much improvement. Ran this script on Liquid and my D1 has some serious zip!!! I was even running a 900 Mhz kernel on Cyanogen and now am running a 800 Mhz kernel on Liquid. The speed increase is absolutely unbelievable.
  11. jgmarz
    Offline

    jgmarz New Member

    Joined:
    Nov 26, 2009
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    NJ
    V6 Supercharger

    Can I download this to sd card and load via CWM?
  12. jstafford1
    Offline

    jstafford1 DF Super Moderator Rescue Squad

    Joined:
    Nov 15, 2009
    Messages:
    9,060
    Likes Received:
    128
    Trophy Points:
    63
    Location:
    Hebron, Oh.
    Doesn't work that way...

    Download it, remove the .txt and run through script manager and you're golden.

    sent from somewhere...
  13. sbenson
    Offline

    sbenson New Member

    Joined:
    Jan 19, 2011
    Messages:
    2,370
    Likes Received:
    61
    Trophy Points:
    0
    Location:
    Virginia/DC Metro Area
    It's about time this made its way to droid forums! Zepp you're the man :)


    Mod edit *watch the language please*
    Last edited by a moderator: May 19, 2011
  14. Snow02
    Offline

    Snow02 New Member

    Joined:
    Jan 12, 2011
    Messages:
    1,342
    Likes Received:
    9
    Trophy Points:
    0
    Works great. Thanks.
  15. zoomy942
    Offline

    zoomy942 New Member

    Joined:
    Mar 3, 2011
    Messages:
    305
    Likes Received:
    1
    Trophy Points:
    0
    so to run this, can i dl it then use ADB Shell to run it or does it need to be run from terminal on the device itself?

    I'll give this a try with my 125/400 interactive kernel setting
  16. zeppelinrox
    Offline

    zeppelinrox Premium Member Premium Member Developer

    Joined:
    Jan 15, 2011
    Messages:
    512
    Likes Received:
    0
    Trophy Points:
    0
    Thanks sbenson :)

    You can run it in terminal emulator

    Sent from my Milestone Powered by my V6 SuperCharger
  17. sbenson
    Offline

    sbenson New Member

    Joined:
    Jan 19, 2011
    Messages:
    2,370
    Likes Received:
    61
    Trophy Points:
    0
    Location:
    Virginia/DC Metro Area
    Using script manager, it makes it incredibly easy. Plus as the script runs, you get to see what it's actually doing. I really recommend it.
  18. Krooked247
    Offline

    Krooked247 New Member

    Joined:
    Aug 20, 2010
    Messages:
    174
    Likes Received:
    9
    Trophy Points:
    0
    Glad to see this stickied as it definitly deserves one.
    Only thing that could fix my redraws... the local.prop edit alone never really worked for me but this has definitly helped a lot.

    Thanks for dropping this knowledge on me and feeding the rest of the droid community.

    Krooked all day....
  19. db306
    Offline

    db306 New Member

    Joined:
    Feb 26, 2010
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    0
    Will this work for the X?
  20. zeppelinrox
    Offline

    zeppelinrox Premium Member Premium Member Developer

    Joined:
    Jan 15, 2011
    Messages:
    512
    Likes Received:
    0
    Trophy Points:
    0
    Thanks guys I'm glad you like it :?
    Definitely. just set slot 3 to the minimum free ram you want in custom settings

    Sent from my Milestone Powered by my V6 SuperCharger
Search tags for this page
android v6
,
bulletproof launcher
,
hard to kill launcher
,
supercharger android
,
supercharger script
,
supercharger v6
,
supercharger v7
,
supercharger v7 android
,
v6 script
,

v6 supercharger

,
v6 supercharger for android
,

v6 supercharger script

,
v6 supercharger script download
,
v6 supercharger widget
,

v8 supercharger script