yashsingh1/xdaforums huggingface dataset:
[Magisk] liver20:
Any pixel 2 xl?

Enviado desde mi Pixel 2 XL mediante Tapatalk
[Magisk] EarlyMon:
0 swap, like the second picture in the first post.

That's unusual. May I ask what other modules you are using and what other modifications, if any?

And you used the one in the first post?
[Magisk] kouzelnik3:
What should it show in terminal?

I am using it on LG G4 v29 (Nougat beta) and it doesn't show anything when I write "cat /proc/swap*". :/
[Magisk] EarlyMon:
You may be interested in the Android adjustments for managing low memory.

If you haven't tried that already, there are various apps that can help - Kernel Adiutor has various profiles built-in for you to try, under "low memory killer." Take a screen shot of your defaults before playing.

Here's what the adjustments are for (a golden oldie but still the stuff to know) -

https://m.androidcentral.com/fine-tuning-minfree-settings-improving-androids-multi-tasking

I'd try with and without the Swap Torpedo, but either way, I'd give that a try given your results.

No offense meant if you've already done this! ;) :)

Edit - And per what [MENTION=5488402]Davey126[/MENTION] said, Kernel Adiutor also has some ability to adjust zram size. Try the minfree settings mentioned above first though.

And remember - record your defaults before playing.
[Magisk] DB126:
KA is a good app with a few warts. Dynamically adjusting zram is one. Be sure to stow all sharp objects in advance if you decide to play with this slider. Better yet, heed [MENTION=2682748]EarlyMon[/MENTION]'s guidance and stick with LMK and minfree settings first.
[Magisk] EarlyMon:
[MENTION=7793811]axit50[/MENTION] You *may* want to try the above advice as well.

However - in my limited personal experience, making low memory adjustments on a 1 GB device is pretty difficult. I'd found mine to be hyper-sensitive to small changes and very time consuming.

But, provided that you record your defaults so that you can be sure about going back, it's another tool to try if you want.

Didn't want you to think that I was discriminating indiscriminately - but only because of the anticipated amount of effort.

Let me know if you have success with this. :)
[Magisk] axit50:
Well.. I am actually from a commerce background and I am little passionate about technology so I know only few things in android. If you want me to try out KA, please suggest me the setting which is best for me, I don't play games but do social media and I have installed HEBF optimiser .. I don't know what will be the effect of KA with this as both are tuning the kernel.. you can show me path on which I can go. Thank you
[Magisk] EarlyMon:
Uninstall HEBF to try this. You don't want both.

KA has presets for you to try called profiles on that page of the app.

Try Light first. Set the boot switch on top, reboot, see if it's good for you.

If you like that, try Very Light.

If you start getting unexpected reboots, go up to the next level - for example, from Light to Medium.

If one seems pretty good, change Swap Torpedo (from not there to on or vice versa) and see if that change helps. If not, change back.

Run for a day or two or as necessary to decide if you are getting better performance this way or if HEBF was working better for you.

Reset the sliders back to the defaults before changing back to HEBF.
[Magisk] heichi13:
I really have to thank you [MENTION=2682748]EarlyMon[/MENTION] for this module. Gave my phone a second life, basically. Here's to years more on a 2014 phone! This makes Oreo super smooth!
[Magisk] EarlyMon:
Nice! Glad it's helping. :)
[Magisk] pinket:
How about 1gb?

Hi,

You mentioned devices with less than 1gb not needing this and devices with more than 2gb definitely needing this.

how about the majority of devices out there with 1gb like mine?

My free ram is usually around 150mb up to 200mb depending on what I'm doing.

Device feels laggy at times even though there is a 150mb ram free.

Could your module be helpful in this situation without the device running out of ram?

Advice appreciated.

Mike

Oh, forgot to mention zram is at 500mb according to true ram.
[Magisk] madbat99:
This is more for devices with 2GB of RAM and up. 1GB or less, not so much.
[Magisk] DB126:
500 MB or zram on an 1 GB RAM device is ridiculous. Push that down to something in the 128-256 MB range. You'll probably find your device is a whole lot more responsive provided you don't have 8000 things loaded.
[Magisk] EarlyMon:
What I'm trying to say is that I can appreciate the greater need to help out 1 GB devices - and so zram may help more than removing it with this module.

I'm not sure.

But not all devices are equal - some run less with a nearly-pure standard Android while others have a heavier manufacturer user interface running.

Then - what about your apps vs the next guy?

I've personally hated zram on devices with 2 GB or more but just a few posts up is a user with 2 GB who did not get the results desired from this module and went back to using zram.

I can't call him wrong, that would be silly. He knows his phone and he knows how it's working.

I understand the desire to have a rational guideline, I really do.

But I've given you something much better.

You can try this and if you don't like it, uninstall it. It doesn't permanently change your system and once you remove it, it's as if it was never there. Free.

Only you can do you with your phone and not all "x GB RAM" phones are equal.

Try it. Use it if your experience improves and remove it if it does not.

Swap Torpedo adds nothing. It stops something that many people do not need. That's its power. If its stopped something YOU needed, get rid of the module and either way you go, my thanks for trying it.
[Magisk] DB126:
Don't undervalue the significance of this characteristic. Far too many well meaning 'tweaks' leave permanent scars that are difficult to eradicate without a full refresh. Swap Torpedo is truly systemless with no remnants or undesirable side effects once uninstalled (a reboot is still advisable).
[Magisk] EarlyMon:
A reboot is required. :)
[Magisk] Zander_:
Will this improve performance on an LG g6 h870? What's the trade off?
[Magisk] EarlyMon:
I maintain that it will improve performance, other LG owners agree with me.

The main trade-off is that you *may* have reload some apps more often during multitasking app switching.

The irony of that is that I've had one report on another phone scoring lower on a synthetic benchmark - while actually running better and visibly faster. Yet another example of synthetic benchmarks being useless for anyone besides the marketing department and blog writers.

Overall, what you do run will run faster because the Swap Torpedo gets rid of processes that are wasteful for most people at boot up and it is NOT a task killer.

The other trade-off is that for some people, those processes are not wasteful and if you are one of them, your phone will slow down.

That is absolutely something that you can't sort out with calculations and arguments ahead of time - the only way to know is to try it.

There is no downside to trying it if you are a Magisk user. None. If you uninstall the module your phone will behave as it did before you tried it.

The Swap Torpedo leaves NO residue or side effects behind once uninstalled. None. Zero.

In your case (and you're in the majority on this) it's going to run 3 commands at boot time to reconfigure the virtual memory - two commands are to set up the single effective command. After that, it's done until needed again at the next boot.

Try it and see how it works for you. :)
[Magisk] cambr1an:
Unfortunately I had to uninstall because on my device with 3GB RAM Tasker stopped working randomly (perhaps Android is killing it due to low RAM?). It was worth trying though. Thanks!
[Magisk] EarlyMon:
Is Tasker on the not optimized list for Battery optimization?
[Magisk] cambr1an:
Yes indeed it is. Also, RAM Truth says that I only have around 300 to 500 MB available RAM at any given time. Not sure if that's a bad sign. (Attached screenshot is after I disabled Swap Torpedo).
[Magisk] EarlyMon:
Neither good nor bad, merely a characteristic of your configuration and your use.

If we could tell good from bad we could add a monitor and dynamically adjust it for each user.

But we can't and that's why Kernel Adiutor and other apps let you adjust it manually by tinkering with your minimum free (minfree) out of memory (OOM) adjustments and see if you can do better than the guess distributed with your rom. (Details on all of that are in posts not much earlier, on this page if you're showing 40 posts per page - if you are interested in learning more about this.)
[Magisk] DB126:
Off Topic

Reviewing and potentially adjusting LMK values is another method for improving responsiveness on devices where zram can not or should not be disabled. Many manufactures use ridiculously aggressive default values resulting in apps/services/components being tossed from memory long before the device is stressed. In many cases that conservative action generates additional CPU and swap activity as Android attempts to preserve app context before honoring the request.

Discussing how to tune LMK is well beyond the scope of this thread. However, one only needs to increment the first 5 segments by small amounts (say 8 MB) to achieve the desired prioritization. The last value (empty apps) should generally be quite a bit higher; perhaps 2X its predecessor. I usually start at 32 MB, march up by 8s to 64 MB (32, 40, 48, 56 64) then set empty apps to 128 MB. Works a treat. As a side benefit you may see a slight reduction in battery consumption. Obviously YMMV.

Enjoy.
[Magisk] EarlyMon:
I'm ok with a little off-topic if it helps people - as you've seen, I've done it myself. ;) :)

For the reasons you've covered, I don't see a downside exploring LMK values even when zram is disabled.

Google does not disagree fwiw.

Of course, too much and it would be better served in a dedicated OOM settings thread - for user benefits, not mine ok.
[Magisk] LaiCORE:
[MENTION=2682748]EarlyMon[/MENTION]

Hi

Phone Xiaomi Mi2S (2 GB of RAM) and ROM cm12.1

command cat /proc/swap* does not show anything
[Magisk] EarlyMon:
How much swap does RAM Truth show?
[Magisk] LaiCORE:
[MENTION=2682748]EarlyMon[/MENTION]
[Magisk] EarlyMon:
[MENTION=5889685]LaiCORE[/MENTION] Your configuration does not have an active swap, so /proc/swap* has nothing to show.
[Magisk] LaiCORE:
then the module will not work?
[Magisk] EarlyMon:
Correct. :good:

You already have what the module provides - or technically - you already don't have what the module takes away.
[Magisk] :
Installed on my g900w8 with 2g ram

No more lag when minimizing apps or switching between them. I sometimes had 2-3sec delays prior.

Thanks :)
[Magisk] EarlyMon:
My pleasure. :)
[Magisk] AlexxAnders:
Thank you [MENTION=2682748]EarlyMon[/MENTION]!

It works:svetius:

Somewhere you wrote, that Swap Torpedo kills your favorite music app. I can't find this line again.

What do you mean by that?

I'm asking, because I also have a problem with a music app, which stops streaming after 10 min when in Standby.
[Magisk] EarlyMon:
Most definitely, but the other way around - and that may have been in the honor View 10 forum. One I remember offhand was USB Audio Player PRO - and yes, about five or ten minutes in with it in the background while browsing or emailing, or just screen off - it would stop. Some others did the same thing.

You have to make sure that you have the music player app set to not be targeted by EMUI for any type of power saving - and normally that would be enough, or so I expected from other Huaweis. But - it's not enough with EMUI 8.

Getting rid of swap with Swap Torpedo was the final piece required, and after that, zero problems. :svetius:

Glad it's working for you, if you need help, let me know. :)
[Magisk] oreo27:
Quick questions before I go ahead and run this.

1. If I uninstall this module at a later time, will all changes be reverted? All changes seem to only touch on /sys which as far as I understand get reverted every reboot?

Whoops.

2. I should be seeing performance improvements with a 4GB device, correct?

Checked out my swap. I was using ~512MB. Intalled the module. Will note if there are any improvements. It's pretty fast as is.
[Magisk] sarp41:
Greetings,

I'm seeing this values after installing this module. Idk if it's normal though but before this module it was using little much more zram.

Thanks.
[Magisk] godofsalt:
Earlymon,

Same sort of thing.... The ROM has a Zram Cache. So, will this help any? I have taken it a bit more, though, I did take "Swappiness" to 0.0! In the App recommended, Ram Truth, it only shows the Zram, (mine at 810mb) but has the other setting at 0.0 (Used, I believe)

Secong Q- so would this module still be good with a ZRam Cache?

Thank you for all your hard work on this! I see how this would have helped the other phones, I have had!!!
[Magisk] EarlyMon:
That's certainly unusual. Please show me the output of

cat /proc/swap*

OR (are you saying) - did you uninstall the module and your used zram hasn't risen back to its previous level yet? If it's that, that's normal for a lot of uses - and perfectly ok. The amount of used zram may exhibit patterns to you but it's a dynamic value by design.

Taking swappiness to 0 causes the system to use swap only when absolutely needed (keeping it simple and less technical here). That you now have zero swap used means what it says - zram processes are running but it hasn't been needed (per the "swappiness definition of need").

I would keep it simple - put swappiness back to the default in case you change your mind or your needs in the future and just use Swap Torpedo instead. Then if you want swap back, just uninstall the module.

Zram is a swap technology, so I suspect that "zram cache" is a confusion of terms or someone has implemented zcache. Please show me the output from the command above, let's see. :)
[Magisk] sarp41:
No, what i'm saying is when I installed this module for the very first time, my zcache went lover. Maybe that's because these things are dynamic. I don't know much so... :) Let me know if this attachment is what you needed. Thanks again... Btw, I have deodexed rom and some VM tweaks including swappiness but actual VM value. So 512MB is stock setting i guess. Cheers...
[Magisk] godofsalt:
Earlymon (sorry so big, copied from Ram Truth as u can see.)

OK, running the Terminal command pretty much gave me same output.

And Yes, have your mod installed.

RAM Truth [ 2 GB ]

Reserved: 347.99 MB

User: 1700.01 MB

Active: 1324.36 MB

Available: 375.65 MB

Hibernating: 337.10 MB

Idle: 38.55 MB

Swap (total): 810.00 MB

Used (zram): 284.77 MB

Device Info:

Android: 8.1.0

Device: kltespr

Model: SM-G900P

Maker: samsung

RAM Truth: v1.4
[Magisk] EarlyMon:
Ok, many thanks for the clarification, I understand. (And fwiw, you don't have zcache, you have zram.)

A normal entry would begin with

/dev/block/zram0

^ And that's it.

The "\040(deleted)" *probably* means that something tried to unmount zram0 and failed, leaving the system in a somewhat confused state (where "tried to unmount zram0" means that you can think of that as meaning, "tried to disconnect zram0" and be ok with that understanding).

Swap Torpedo isn't designed to recognize that properly and even if it were, I doubt it could work right because your zram mount (iow, connection) is stuck in an error state.

The prime suspects are Swap Torpedo or whatever you used to make VM adjustments.

Swap Torpedo calls swapoff and that calls the library in your rom - the same one that set up zram successfully in the first place. Possible. Anything is possible.

Uninstall the module. Revert your VM settings to the defaults. If you used an app to change the VM settings, uninstall it.

Reboot and check /proc/swap* again.

If it it shows anything other than the normal "/dev/block/zram0" STOP and show me.

If it is normal again, reinstall Swap Torpedo - check /proc/swap* again - and show me.

Pretty good chance we can get this sorted out.
[Magisk] EarlyMon:
Ok so we might not share the same definition of "pretty much" so I'll need to see it.

If it has "\040(deleted)" at the end, I'd still like to see it - and you're going to want to follow the same procedure as above.

Let me know!
[Magisk] godofsalt:
OK, have read the posts, and see what you mean. Will get back in a couple of hours with reports
[Magisk] dviree:
Hi

I love this module and it makes my phone faster but the thing is that sometimes it closes Spotify. When I remove this module my Spotify doesn't randomly close anymore.

Is this a bug? What can I do to stop Spotify from closing while using this module?

I really want to reinstall this module on my phone
[Magisk] EarlyMon:
Glad you like it - and losing functionality is not ok, I agree completely.

Whether or not we can sort it out with the module in place could depend on some different factors. Please let me know what phone you have along with how much RAM, and whether you are using anything else to help boost performance.

If those things don't appear to be obstacles, you'll want to check this and the following 4 posts -

https://xdaforums.com/showpost.php?p=76111045&postcount=181

Let's start with what you have, let me know. :)
[Magisk] DB126:
Pretty good bet overly aggressive LMK values are the bad boy assuming no other power/performance tools are in play. Try the following assuming your device is equipped with 2 GB RAM or more:

LMK thresholds (in MB): 16/24/32/48/64/128

LMK thresholds (in MB): 32/40/48/56/64/128 (bloated devices)

These should work regardless of the presence zram or file based swap. You can bump the last value (empty app) to 192 or even 256 MB on devices with substantially more RAM with little/no impact on performance or battery life.
[Magisk] wavedashdoc:
I'm going to test these LMK values on my Nexus 6 which has 3gb of ram ?
[Magisk] Gaffadin:
I've noticed that with this module enabled, my phone (OnePlus 2, LOS 14.1) will not enter Deep Sleep. Is this intentional?

BetterBatteryStats has no entry for Deep Sleep with the module enabled, but when removed I can go into Deep Sleep again.
[Magisk] EarlyMon:
At boot time, your phone basically runs swapon (through an internal call) included on your phone - when it finishes, Swap Torpedo runs the swapoff command included on your phone - and then exits and does nothing until the next boot up.

If your phone doesn't get to sleep the same or better without swap running, then something in your rom is requiring it.

(Or maybe a 0.01% chance that your swapoff command is broken, which I doubt because I had to make that number up.)

I agree that deep sleep is important - thanks for trying the Swap Torpedo and maybe try it again with your next phone or rom. :)
[Magisk] Gaffadin:
Thanks for the explanation.

It really sucks, because this module made my O+2 so much snappier and responsive then before... But I really need Deep Sleep.
[Magisk] EarlyMon:
Your other possibility - you have an app throwing wakelocks that was getting swapped out - and you probably looked for that already.
[Magisk] Gaffadin:
I have indeed checked. With the module enabled, I start seeing additional wakelocks for "qpnp_fg_memaccess" and "qpnp_fg_update_sram" and my CPU stays on its lowest level of 384MHz. Without the module, these wakelocks are still there, but for only a couple of seconds, instead of the minutes that they are open with the module, and my phone will go into Deep Sleep.
[Magisk] Schroeder09:
Using this on a pixel 2 XL and it seems to be working. Battery stats were a little weird with high drain after reboot, but I recharged and things SEEM to be stabilizing now. I'll keep you guys updated.

I want to bounce something off all of you. Take a look at the screenshot of my RAM Truth stats. Why is there so little available RAM when I only have the XDA labs app and my messaging app open in the background? It seems like this phone is constantly needing to reload apps. It's the only complaint I have about the device. It acts like it has 1-2GB of RAM as opposed to its 4GB. Shouldn't the available amount be almost close to 4GB minus the reserved portion? Yes, I have clicked on each item in RAM Truth and read which each category is in an effort to understand all this.

I have seen a new wakelock since using this app: UlrDispSvcSlowWL. 186 wakes with a total wake time of 1min 33s (.9%) over about 5-6 hrs. Probably not a big deal. I just thought I'd note this. I'll keep an eye on it and try to remember to post back with my experiences.

I thought I saw mention about people with pixels having trouble with this module. Again, I am on a pixel 2 xl, and I didn't do anything special to get this installed and working. I downloaded the .zip from the OP, flashed via magisk, and rebooted. Worked right away.
[Magisk] DB126:
RAM Truth only shows a high level overview of how your memory is being utilized. While there are many 3rd party apps available you can use what's already built into Android 8.x to see what apps/services are using resources. Tap 'memory' under 'developer options' to see the details. Alternatively, give GSAM a whirl which you can find in the Play Store.
[Magisk] EarlyMon:
Android will keep apps in memory for your multitasking convenience. Unless they are using CPU resources they won't cost you anything for battery life.

And apps are allowed to get permission to launch on boot and that's where the trouble starts. Some apps really need that and you will agree - your messaging and service apps for example.

Unfortunately, many developers abuse that. To see what apps have autostart permission, try Quick System Info PRO, Apps tab, and select whichever group you want to explore. Look for the ones with "auto" to the right of the app listings.

Until there's a way to control that permission, you'll have to be careful about what you install and how it behaves, or look for a root mod to limit that.

If you want an easy way to limit it, you can try setting the app limit in Developer options, Background process limit. Try 4 and see if you prefer it. Use with CAUTION. Don't go nuts there.

If your phone is behaving well despite the RAM usage - do nothing. Android is pretty smart about managing your resources unless you have a bad app that misbehaves.

Pretty sure that UlrDispSvcSlowWL is one of the location wakelocks. That would suggest that something that was normally getting swapped out is living in the background and waking up as you noticed.

Pixel users had trouble with version 1.0 of the Swap Torpedo, along with others with different phones. Those were all the result of different timing errors and how the zram swap isn't implemented the same everywhere. That was all fixed in version 1.1.

Thanks for the detailed report, definitely keep me updated if you have time, and thanks for trying the module, glad you like it. :)
[Magisk] EarlyMon:
I don't know if you had a chance to look those up - I was curious so I did.

The consensus seems to be that they're in response to services pinging for data. A lot of people seemed to face them on Nougat (that matches what you have) especially and claimed no end of process and configuration causes, usually without any solid, acceptable solution. Like all problems like this, it's impossible to say what percentage of N users were hit. Some reported not getting rid of them whether zram was in use or not.

Either way, if your rom doesn't have trouble with those while using zram, my original advice stands.

Thanks for the further report, I'm sure it may help others! :)
[Magisk] richmardeasis:
before and after.

is this the expected outcome?
[Magisk] EarlyMon:
Yep!
[Magisk] Schroeder09:
Been a day or 2 using this on the pixel 2 XL and battery life is .7% idle drain and 12.7% active drain. That's 1-2% better for active and .1-.15% better for idle drain. Still only been a day, but with Google play services update I did yesterday too, I think it's safe to say that this at least won't NEGATIVITY affect battery life. I'll try reporting back in 1 week again too. Thanks!
[Magisk] DB126:
FWIW - those numbers parallel what I experienced disabling zram on a lightly taxed 2 GB device that with no big memory consumers like games. Could also see the difference in screen off CPU times and frequencies utilized. Subtle but consistent.