[Q] lowmemorykiller init.shooteru.rc

Search This thread

Swarvey

Senior Member
Aug 16, 2007
108
6
Sunshine Coast
MULTITASKING ISSUE SOLVED!
for me anyway :D

Yes this is about the terrible HTC multitasking problem.

1st off here are some points
* I love my Evo3D, I've repaired it several times, from several faults, there just isn't another phone I like, so I'm not interested in upgrading to something new.
* Secondly, yes I have searched, I've been searching since the ICS update, nothing I've found works, only thing that comes close is the v6 supercharger.
* Until a COMPLETELY functional, stable ROM appears, and I mean EVERYTHING working, 3D, 3D Camera, EVERYTHING, I'm not moving up from the stock ICS ROM, there's simply no point in going to CM or anything else, when the 3D functionality doesn't work.
* My ROM is as follows:
Android Version: 4.0.3
HTC Sense (ugh) version: 3.6
Software Version: 3.28.401.1
Kernel: CoolZ v5.7

The problem is the terrible multitasking, which I'm pretty sure I've nailed down to OOM grouping, but not in the way most people might think. So here goes.

What has helped is the V6 Supercharger, but it just barely helps with OOM values. Which lead me to try other options and other applications, one of which is ROM Toolbox. The task manager in this suite allows the adjustment of OOM values and can display OOM grouping. Combine this with the bulletproofing performed by v6 supercharger and I can see something happening. My bulletproof script is set to run every 30 seconds, so I would expect to see the OOM grouping of the apps staying as "excluded". But it's just not sticking. They initially show as excluded, but minutes later, they're back to being either foreground, hidden or content provider. I can also force them to loose their "bulletproof" or "excluded" status, merely by turning my screen off and on again. Something, somewhere in the system is changing this.

So then I started stuffing around (rather drastically) with the OOM killer values, I set them rediculously low:
Foreground: 1
Visible: 2
Secondary: 3
Hidden: 4
Content: 5
Empty: 6
See? drastically low, BUT I got a result. The three apps I have open nearly all day, were now staying open, but the problem became lag, which makes this method of "multitasking" useless. I also noticed that other apps were being killed before empty apps etc. So something is seriously screwy.

Back to the drawing board, I wanted to find out why excluded apps priorities were being changed without my knowledge. I know pretty much nothing about android, so I did some googling. Found out that deeper in the system the oom grouping was being assigned by the kernel etc. Beyond my knowledge or ability. For a laugh I started poking around in the system folder, more specificially at the init.rc and init.shooteru.rc files. As it turns out, inside init.shooteru.rc are some lines that are designed to override the OOM adj and OOM. So I thought I'd remark the lines with #'s so they would be ignored during boot. The code below is the result.

Code:
on property:init.svc.bootanim=stopped
    start qcom-post-boot
    # Overwrite ActivityManager's low memory killer settings
    #write /sys/module/lowmemorykiller/parameters/adj 0,2,4,7,9,12
    #write /sys/module/lowmemorykiller/parameters/minfree 6379,8125,9871,11919,20497,25282
    #write /sys/module/lowmemorykiller/parameters/minfile 6379,8125,9871,11919,20497,25282
    #write /sys/module/lowmemorykiller/parameters/check_filepages 1
    start mpdecision
Unfortunately, after pushing the code back to the device and rebooting, my hard work had been undone, so I pushed again, sync'd again, but this time, I've used ROM toolbox to do a "fast reboot" then "reboot systemui" It would appear that the modified file is still indeed modified, however I have no way of knowing if the fast reboot or reboot systemui has forced my device to reload the init.shooteru.rc script. So this may be a fluke.

So I did the above and launched two of my three apps. Remembering bulletproofing runs every 30 seconds, so the apps should be showing as "excluded" by the task manager in ROM Toolbox. Sadly this is not the case. Dolphin browser for example, has been running for just over 7 mins in the background, it is no longer "excluded" now it has become a "content provider" BUT, I have just switched back to it, and all three tabs are still loaded and have not had to redraw, success? Maybe. Even more surprisingly, I have just been able to turn the screen off, turn it back on after a few seconds (which probably means nothing as it won't have gone to "deep sleep" yet) but Dolphin and it's three tabs, and two other apps have remained open and I was able to swap back to them without reload or redraw. This has really intrigued me as normally my apps that I want to use are being closed killed before other empty apps.

So have I stumbled across something here? or is my phone just fluking and the apps staying open for some other reason? Personally I think it's just a fluke. As far as I can derive from months and months of searching, I believe either the kernel is reassigning OOM grouping on the fly (which makes the v6 bulletproofing useless) or the HTC framework is a mess and destroying the OOM grouping, adjustments etc.
 
Last edited:

PlayPetepp

Senior Member
Dec 19, 2010
2,128
656
Osijek
Xiaomi Mi 11
You can't push init.shooteru.rc to system and expect it to stick after a reboot. It's actually packed in boot.img which also includes the kernel (zImage) and it's rewritten on every reboot. Only way to change those parameters is to unpack boot.img with android kitchen, change values inside, repack and flash via fastboot. I actually did that on cool ics rom but after a while phone became slow and started rebooting (apps were not being killed at all lol). Kernel manages memory maping and really sucks about it. I'm using cm11 currently (just about to flash LS3.0) and on average I have 300-350mb free ram but browser always redraws pages. It's because if you're not using your phone for a longer period of time (more then a few minutes) everything gets pushed back to lower app class so syncs, launcher, notification bar and other apps we can't really control get available space so your phone doesn't slow down too much. Get a phone with 1.5/2gb of ram at least and you won't suffer that issue.

-. typewrited .-
 
Last edited:
  • Like
Reactions: Swarvey

Swarvey

Senior Member
Aug 16, 2007
108
6
Sunshine Coast
You can't push init.shooteru.rc to system and expect it to stick after a reboot. It's actually packed in boot.img which also includes the kernel (zImage) and it's rewritten on every reboot. Only way to change those parameters is to unpack boot.img with android kitchen, change values inside, repack and flash via fastboot. I actually did that on cool ics rom but after a while phone became slow and started rebooting (apps were not being killed at all lol). Kernel manages memory maping and really sucks about it. I'm using cm11 currently (just about to flash LS3.0) and on average I have 300-350mb free ram but browser always redraws pages. It's because if you're not using your phone for a longer period of time (more then a few minutes) everything gets pushed back to lower app class so syncs, launcher, notification bar and other apps we can't really control get available space so your phone doesn't slow down too much. Get a phone with 1.5/2gb of ram at least and you won't suffer that issue.

-. typewrited .-
So does changing the values, pushing the file, then doing a "hot reboot" or rebooting the systemui change anything?

The phone performed quite well yesterday, until the battery went flat, rebooted and lost the changes.

I'm more than happy to unpack, change, repack and flash.
 

PlayPetepp

Senior Member
Dec 19, 2010
2,128
656
Osijek
Xiaomi Mi 11
So does changing the values, pushing the file, then doing a "hot reboot" or rebooting the systemui change anything?
No. Only unpacking/repacking and flashing boot.img with that file change inside.

You could also use an app from google play store to change oom values and tick the "stick after reboot" option so it will apply those on bootup. One thing you can't do in any way is change app classes which are handled by android OS itself.

-. typewrited .-
 
Last edited:
  • Like
Reactions: Swarvey

Swarvey

Senior Member
Aug 16, 2007
108
6
Sunshine Coast
As I previously mentioned, I've used the v6 supercharger, which changes the OOM values. And it sticks. But I'm not talking about changing OOM values, rather how the classes can be assigned to an app, but are seemingly reverted.

Eg. V6 supercharger can "bulletproof" an app, by changing the apps OOM class to -17, it should stay that way, but it is changed to a higher value at seemingly random times. Sad fact is, an apps class can be changed by the kernel, oom'd out and closed, often this will happen before the script relaunches, making this part of the V6 supercharger script useless.

The multitasking issue that plagues HTC devices, from what I have experienced is down to the kernel adjusting OOM classes, to the point of reverting "excluded" apps with an OOM value of -17, something higher (no longer excluded). if I can get excluded apps to stay excluded it would be problem solved. When I saw these overrides in init.shooteru.rc, more particularly the oom_adj override, I thought I was onto something.

I thought the oom_adj changes made by init.shooteru.rc were overriding android defaults and forcing OOM classes per app.

Oh well, guess it was a long shot.

So does this mean that there is no way to undo what HTC have changed?

Sent from my HTC ShooterU using Tapatalk
 

PlayPetepp

Senior Member
Dec 19, 2010
2,128
656
Osijek
Xiaomi Mi 11
I thought the oom_adj changes made by init.shooteru.rc were overriding android defaults and forcing OOM classes per app.
They do if they're changed from inside boot.img, not after the device boots and already loads all values. But kernel/framework will eventually override them.

So does this mean that there is no way to undo what HTC have changed?
Maybe you could apply V6 and use those values to enter them in init.shooteru.rc, repack boot.img and flash via fastboot. That way both locations should be altered (boot.img and framework). Then you can see if the app classes change or they stay the same. Next thing I suggest you try if the above method doesn't work is tweaking values inside the kernel itself. It's the only place left to look.
 
Last edited:
  • Like
Reactions: Swarvey

Swarvey

Senior Member
Aug 16, 2007
108
6
Sunshine Coast
So theoretically, if I just remark / remove those overrides from init.shooteru.rc repack and flash, the phone would then run android/kernel default values for oom and adj?

Sent from my GT-P5100 using Tapatalk
 

PlayPetepp

Senior Member
Dec 19, 2010
2,128
656
Osijek
Xiaomi Mi 11
Never tried deleting them from init.shooteru.rc. I think those are also the defaults so my guess is yes. Make a backup of boot.img before flashing just to be on the safe side.
 
  • Like
Reactions: Swarvey

Swarvey

Senior Member
Aug 16, 2007
108
6
Sunshine Coast
Cool, sounds like I have something new and fun to play with on a wet Saturday. Hopefully this will solve the multitasking once and for all.

Sent from my HTC ShooterU using Tapatalk
 

Swarvey

Senior Member
Aug 16, 2007
108
6
Sunshine Coast
Just a quick update, I have finally managed to extract, unpack, modify, repack and flash a new boot.img file, with the HTC overrides omitted.

It's looking very promising so far, I'm still using the 256hp minfrees from the V6 supercharger, but I've pushed empty apps up to 100mb. The phone is behaving very nice indeed. "Bulletproofed" apps are still being adjusted, but not to an empty app state. The lowest I've seen them is content provider, which isn't being killed. Memory seems to be hovering around 150mb (reported) free, there's only minimal lag, but the big bonus is multitasking, I can now (and have been all afternoon) switching between two chat apps, Dolphin browser with 4 tabs, photo blogs, eBay and other miscellaneous apps, without them being killed. I estimate the phones "up time" as approximately 3 hours. The only niggle is that Dolphin browser had to reload it's tabs once, but only once.

I think I may be onto something here....

Sent from my HTC ShooterU using Tapatalk
 
  • Like
Reactions: PlayPetepp

Swarvey

Senior Member
Aug 16, 2007
108
6
Sunshine Coast
Minfrees are as follows:
Foreground 8mb
Visible 12mb
Secondary 22
Hidden 24
Content 26
Empty 100
Originally V6 supercharger settings put empty apps as low as 85mb, but by definition empty apps are pretty much just wasting precious ram so I upped it to 100

Also, because I already have V6 running at boot, I didn't have time to check the default values. As a pleasant surprise, I just checked with ROM toolbox and my bulletproof apps are indeed excluded, so I think it's safe to say I've made progress.

Attached is a screenshot, 220mb+ reported free uploadfromtaptalk1393066342390.jpg

Sent from my HTC ShooterU using Tapatalk
 
  • Like
Reactions: PlayPetepp

Swarvey

Senior Member
Aug 16, 2007
108
6
Sunshine Coast
Ahh, something must have eaten too much memory, after posting that screenshot I realised that was 50mb or so too much, sure enough, Dolphin had to reload 3 tabs, but it hadn't actually been killed yet. Other apps are still fully multitasking, but there's also sooo much less lag now.

Honestly I hope this info helps someone else too, but I'm just sooo fkn happy with this phone right now, it doesn't matter, I'm finally able to multitask! Mission accomplished!

Sent from my HTC ShooterU using Tapatalk
 

Swarvey

Senior Member
Aug 16, 2007
108
6
Sunshine Coast
Just pushed empty app minfree up to 150mb, now showing virtually no empty apps in memory, approximately 200mb reported free, multitasking still fluid

Sent from my HTC ShooterU using Tapatalk
 
  • Like
Reactions: PlayPetepp

somekid15

Senior Member
Apr 6, 2013
272
38
You guys are all reporting 200 MB free ram as a good thing? At almost all times I have between 300-500 MB free ram..

Sent from my Evo V 4G using xda app-developers app
 

somekid15

Senior Member
Apr 6, 2013
272
38
According to your signature, you're using a different device. This thread is for the Evo 3D, not the Evo V or 4G

Sent from my HTC ShooterU using Tapatalk

The evo 3d is just the sprint variant of the evo v which operates on virgin mobile. They share the same specifications if I'm not mistaken

Sent from my Evo V 4G using xda app-developers app
 

Swarvey

Senior Member
Aug 16, 2007
108
6
Sunshine Coast
Are you using ICS?

My GSM Evo 3D is running the stock ICS with as much sense crap removed as possible, with over 200 apps installed (including system apps), several apps constantly running services or content providers in the background.

And only after I modded my boot.img can I now successfully multitask.

Android v: 4.0.3 ICS
Sense v: 3.6
ROM v: 3.28.401

Besides the point, this is a GSM thread, the CDMA sprint version has been reported to perform better than GSM versions.

Personally I don't care if your device has so much ram to spare, this is a thread for GSM variants and other people suffering multitasking woes. I respectfully ask if you have nothing constructive to add re: GSM variants, please don't add to the thread at all.

Sent from my HTC ShooterU using Tapatalk
 
Last edited:

PlayPetepp

Senior Member
Dec 19, 2010
2,128
656
Osijek
Xiaomi Mi 11
Let's take it easy, shall we?! :)
My GSM Evo 3D is running the stock ICS with as much sense crap removed as possible, with over 200 apps installed (including system apps), several apps constantly running services or content providers in the background.
Android v: 4.0.3 ICS
Sense v: 3.6
ROM v: 3.28.401
I'm back on CoolICS and already applied V6. Later today I'll try Jar Power Smali Patcher to patch my services.jar and change values inside boot.img so it's a complete overhaul. I'll post my results as soon as I'm done. It'll probably be later tonight since I have a rather busy schedule today, sigh. :rolleyes:
 
  • Like
Reactions: Swarvey

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    You can't push init.shooteru.rc to system and expect it to stick after a reboot. It's actually packed in boot.img which also includes the kernel (zImage) and it's rewritten on every reboot. Only way to change those parameters is to unpack boot.img with android kitchen, change values inside, repack and flash via fastboot. I actually did that on cool ics rom but after a while phone became slow and started rebooting (apps were not being killed at all lol). Kernel manages memory maping and really sucks about it. I'm using cm11 currently (just about to flash LS3.0) and on average I have 300-350mb free ram but browser always redraws pages. It's because if you're not using your phone for a longer period of time (more then a few minutes) everything gets pushed back to lower app class so syncs, launcher, notification bar and other apps we can't really control get available space so your phone doesn't slow down too much. Get a phone with 1.5/2gb of ram at least and you won't suffer that issue.

    -. typewrited .-
    1
    So does changing the values, pushing the file, then doing a "hot reboot" or rebooting the systemui change anything?
    No. Only unpacking/repacking and flashing boot.img with that file change inside.

    You could also use an app from google play store to change oom values and tick the "stick after reboot" option so it will apply those on bootup. One thing you can't do in any way is change app classes which are handled by android OS itself.

    -. typewrited .-
    1
    I thought the oom_adj changes made by init.shooteru.rc were overriding android defaults and forcing OOM classes per app.
    They do if they're changed from inside boot.img, not after the device boots and already loads all values. But kernel/framework will eventually override them.

    So does this mean that there is no way to undo what HTC have changed?
    Maybe you could apply V6 and use those values to enter them in init.shooteru.rc, repack boot.img and flash via fastboot. That way both locations should be altered (boot.img and framework). Then you can see if the app classes change or they stay the same. Next thing I suggest you try if the above method doesn't work is tweaking values inside the kernel itself. It's the only place left to look.
    1
    Never tried deleting them from init.shooteru.rc. I think those are also the defaults so my guess is yes. Make a backup of boot.img before flashing just to be on the safe side.
    1
    Just a quick update, I have finally managed to extract, unpack, modify, repack and flash a new boot.img file, with the HTC overrides omitted.

    It's looking very promising so far, I'm still using the 256hp minfrees from the V6 supercharger, but I've pushed empty apps up to 100mb. The phone is behaving very nice indeed. "Bulletproofed" apps are still being adjusted, but not to an empty app state. The lowest I've seen them is content provider, which isn't being killed. Memory seems to be hovering around 150mb (reported) free, there's only minimal lag, but the big bonus is multitasking, I can now (and have been all afternoon) switching between two chat apps, Dolphin browser with 4 tabs, photo blogs, eBay and other miscellaneous apps, without them being killed. I estimate the phones "up time" as approximately 3 hours. The only niggle is that Dolphin browser had to reload it's tabs once, but only once.

    I think I may be onto something here....

    Sent from my HTC ShooterU using Tapatalk