yashsingh1/xdaforums huggingface dataset:
[Magisk] ROKO__:
Its pointless if your swap is in ram anyway.

In new Android versions they've enabled zram swap.

Изпратено от моят Nokia 6.1 с помощта на Tapatalk
[Magisk] titanick:
I'm not sure if I should be using this module, because the amount of zram that I'm using is more than my available RAM. Honor 8 on Oreo.
[Magisk] ROKO__:
My one.
[Magisk] Dreamer(3MF):
According To The Shown Swap (Total) Value 2240.0 MB

Before Flashing The Module

, You Need To Use The Module.

- Generally You Need To Check The Swap Value Before Flashing The Module & After Flashing The Module

- Before Flashing The Module: If The Shown Swap Value Is 0, It Means That You Don't Need The Module

- After Flashing The Module: If The Shown Swap Value Is 0, It Means That The Module Is Working Properly

- IF The Swap Value After Flashing The Module Is Less Than The Swap Value Before Flashing The Module, It Means That The Module Has Some Effect On Your Device

- The Target Of Swap Torpedo Is Swap (Total) To Be 0

According To The Shown Swap (Total) Value 0.0 MB

Before Flashing The Module

, You Don't Need To Use The Module.

- Generally You Need To Check The Swap Value Before Flashing The Module & After Flashing The Module

- Before Flashing The Module: If The Shown Swap Value Is 0, It Means That You Don't Need The Module

- After Flashing The Module: If The Shown Swap Value Is 0, It Means That The Module Is Working Properly

- IF The Swap Value After Flashing The Module Is Less Than The Swap Value Before Flashing The Module, It Means That The Module Has Some Effect On Your Device

- The Target Of Swap Torpedo Is Swap (Total) To Be 0
[Magisk] ROKO__:
I know how it works, and there is swap in zram by default, I just said its pointless for new devices which support zram swap.

Изпратено от моят Nokia 6.1 с помощта на Tapatalk
[Magisk] DB126:
Yep.
[Magisk] EarlyMon:
It's a filesystem entry created by your kernel - and once something is marked for deletion, as far as I recall, that attribute is kept in redundant places.

I'll have to check it out and get back to you.
[Magisk] EarlyMon:
Try it. There's an excellent chance you'll like it.
[Magisk] EarlyMon:
Thanks for your opinions.

On the other hand, there's a large population of people who are not kidding themselves when they report significant positive benefits to getting rid of compressed-ram swap. Outside of specific cases to the contrary, user reports supporting it indicates that it's the vast majority - and has been in repeated incarnations since zram first started.

And then there's the part where zram might be a thing in your view but out in the world it's a family of different implementations, and not all the same.

If keeping zram works in your opinion, keep it. If your zram implementation doesn't suck, keep it. If your situation leaves you with a better running phone, keep it.

If your opinion is that zram is a single thing with a single implementation, works great for everyone and this module is unnecessary for others because it's unnecessary for you, well, thanks for your opinion.

And in case you missed it, this module takes on any compressed-ram swap that it can, not just zram.

The entire matter has been discussed to death in this thread already. If that's not good enough and you find that I haven't been more than fair enough, there's nothing more I can say beyond - facts are greater than opinions. I've respected everyone equally - those who praise the work and those that it didn't work out for.

I'm not sure of the point of repeating pages of discussion about philosophy. If you want to argue about swap and zram theory, read the thread, it's all been said.

My agenda is to add to the methods of people who want and need this sort of thing with a tool that may work where others do not, or work in a better way for those who find that in their case. I've supported other devs as peers rather than competitors and I've supported the decisions of users whose mileage was different from those like me. No billionaires have offered me a million dollars per my second post so I've not accepted donations from anyone - I've said thanks anyway.

If your agenda is to save everyone based on your assumptions and opinions, there are lots of fine venues for that. If your agenda is to show that you know more than me, pack a lunch and get in line.

I think that this is the official support thread for the Swap Torpedo Magisk module.
[Magisk] DB126:
A tad sensitive, my friend. Not to mention a bit short sighted given previous support for your well balanced interactions with posters from all corners of the world. Take a deep breadth while enjoying the beverage of your choosing. The presumption of an agenda is misplaced.
[Magisk] ROKO__:
True. But sometimes we face and placebo effects

Изпратено от моят Nokia 6.1 с помощта на Tapatalk

---------- Post added at 11:58 AM ---------- Previous post was at 11:57 AM ----------

And one more thing. I respect your work. I just note some features.

Изпратено от моят Nokia 6.1 с помощта на Tapatalk
[Magisk] 0LDST4R:
Seems to work. Interesting module. Thanks. ;)
[Magisk] dangerhouse:
is there another way to disable swap?

i'm on nougat with magisk 17.3. (S7 flat), the module have no effect.

funny: on oreo with magisk the module is working, but oreo bother me.
[Magisk] DanGLES3:
Use an app like kernel adiutor if swaptorpedo doesn't work
[Magisk] dangerhouse:
i'm using mtweaks, no possibility to set swap off
[Magisk] xpresotw:
Is it work ?
[Magisk] beez1717:
What is the minimum swap size you'd say is when you need this? Is it a percentage of your total ram? Im curious!
[Magisk] DB126:
2GB is the rough cutoff but it really depends on device (ROM) and workload. I continue to use zRAM on my 2GB and 4GB devices with no ill effects. Others see significant improvements. Try it!
[Magisk] beez1717:
And here I am with a 512 mbb on my 4gb pixel 2 XL. I guess I might as well eliminate it anyway.
[Magisk] DB126:
Be sure to measure before/after results in real world scenarios. You probably won't notice much difference on your 4GB device unless heavily loaded.
[Magisk] ceelos218:
It makes my phone pretty hot.. I'm losing 15%/hr battery compared to 9% without it. i have the essential ph-1 on pie.
[Magisk] DB126:
Yep, that's possible depending on load and kernel as compression can be CPU intensive. I don't notice a dramatic increase in CPU utilization (or battery drain) with ZRAM enabled on my devices. Likely differences in workload. Kernels are all stock.
[Magisk] dangerhouse:
alternative solution for disable swap: ex kernel manager, works in my case

just 4 info
[Magisk] 73sydney:
Sadly it's still not working for me, stopped working several builds ago. Stuck using KA....

Tried again the other night, still fails :(
[Magisk] EarlyMon:
https://xdaforums.com/showpost.php?p=77324247&postcount=431
[Magisk] AgustinH:
Hello! I don't understand very much so here's a screenshot. Does it work?
[Magisk] Ferbee:
I wouldn't recommend using this module as you only have 1gb of ram, if you had a device with more ram then I would recommend it
[Magisk] AgustinH:
Ok, I ask because the phone was fluid
[Magisk] Lomex68:
Hi, did use Ram Truth, as suggested in the moduledescription. It revealed, that 0,5 GB of my ZRam were in use, on a Xperia 6653. Should I keep the configuration, or does a torpedo-impact make sense?

Best regards
[Magisk] DB126:
Give it a whirl if you have 2GB or more of memory (RAM). Easy to reverse if the results aren't to your liking.
[Magisk] 5amar31:
Just installed the latest version of this module on my Mi A1 with October patch & Magisk 17.1. RAM Truth still shows 1536 MB SWAP after 30 minutes since boot. Do you still use this module & which version?
[Magisk] EarlyMon:
Results will appear virtually instantly when all goes well.

Please uninstall the Swap Torpedo and try Kernel Adiutor.

I don't know why some phones prefer one over the other with zram (it goes both ways) but that's how it goes.
[Magisk] bggold:
Just wanted to pass on works great with my pixel 3 xl.

Thanks
[Magisk] 5amar31:
Doing that will probably mess the system partition. I don't want to lose OTA updates. Also in OP you have mentioned it's of no use on Android One devices. The original Android One devices used to have less than 2 GB RAM. Now most of them have at least 3 GB RAM. In case of Mi A1 which is an Android One device, it has 4 GB RAM with 1.5 GB SWAP.
[Magisk] DB126:
No, it won't. But probably best not to mess around with powerful tools if you don't understand how your device works. Kernel and system partition are different beasts.
[Magisk] EarlyMon:
Congrats on your new phone and thanks for the update! :)

When I wrote that, I was speaking to what was available and what was available for me to test.

If you don't want to lose OTA updates, you're going to have to be extremely careful with everything you do with root privileges.

Kernel Adiutor can allow you to modify your system but it doesn't to turn off swap and set zram to zero.

When you are rooted and in doubt, always err on the side of caution.
[Magisk] 5amar31:
I know that. But depends on how Kernel Adiutor mounts partitions & gets permissions. Even granting root permission to a file explorer can sometimes break OTA since most of them mount /system as rw just after giving them root privilege.

---------- Post added at 02:16 PM ---------- Previous post was at 02:13 PM ----------

I've been careful till now with which apps I give root access. Have received 3 OTAs without any issues. Was just hoping this module would work. Can I help with something like logs etc?
[Magisk] EarlyMon:
I very much appreciate the offer, user help is always welcome!

Please post from adb shell or a root terminal emulator window -

cat /proc/swap*
[Magisk] Dreamer(3MF):
Kindly Check This Modified Part Of Code.

alias SWAPT='grep -i SwapTotal /proc/meminfo | tr -d "[a-zA-Z :]"'

while [ ! pgrep android ] && [ `SWAPT` -eq 0 ]; do
sleep 10
done

SR="\/dev\/"
PS="/proc/swap*"

if [ -f /system/bin/swapoff ]; then
SO="/system/bin/swapoff"
elif [ -f /system_root/system/bin/swapoff ]; then
SO="/system_root/system/bin/swapoff"
else
SO="swapoff"
fi
[Magisk] 5amar31:
Filename	Type	Size	Used	Priority
/dev/block/zram0 partition	1572860	575024	32758

cat /proc/meminfo
MemTotal: 3664180 kB
MemFree: 42144 kB
MemAvailable: 1438240 kB
Buffers: 47648 kB
Cached: 1368368 kB
SwapCached: 8784 kB
Active: 1525720 kB
Inactive: 790092 kB
Active(anon): 746060 kB
Inactive(anon): 166084 kB
Active(file): 779660 kB
Inactive(file): 624008 kB
Unevictable: 7048 kB
Mlocked: 256 kB
SwapTotal: 1572860 kB
SwapFree: 1003484 kB
Dirty: 12 kB
Writeback: 0 kB
AnonPages: 903856 kB
Mapped: 520100 kB
Shmem: 5556 kB
Slab: 232148 kB
SReclaimable: 93144 kB
SUnreclaim: 139004 kB
KernelStack: 46768 kB
PageTables: 72772 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 3404948 kB
Committed_AS: 123184472 kB
VmallocTotal: 258998208 kB
VmallocUsed: 234228 kB
VmallocChunk: 258652260 kB
[Magisk] Dreamer(3MF):
Try This Modified One.
[Magisk] EarlyMon:
Many, MANY thanks for the work my friend!

Which device is your mod based on? I haven't encountered that binary path before.

Edit - if /system/bin/swapoff isn't available, then the Magisk internal busybox version ought to have been picked up by the else clause. Indeed, my if statement only prioritizes the ODM's included swapoff before Magisk's, per this path output from Magisk 16 on my phone -

/sbin/.core/busybox:/sbin:/system/sbin:/system/bin:/system/xbin:/vendor/bin:/vendor/xbin:/system/vendor/bin:/system/vendor/xbin:/product/bin:/product/xbin:/odm/bin:/odm/xbin

Would love to hear your thoughts on this, thanks!

[MENTION=7258437]5amar31[/MENTION] - I support the test version by [MENTION=9018566]Dreamer(3MF)[/MENTION] - it attempts nothing nefarious ok. :)

But please try the one at https://xdaforums.com/showpost.php?p=77961528&postcount=488
[Magisk] Dreamer(3MF):
Thanks My Friend @EarlyMon For The Appreciation & Kind Words.

Test Also The Attached Modified One.

Edit: I Read That The System Directory Path For A/B Devices Is

/system_root/system

(Not /system) So I Added That Part. Also Another Check Is Added/Made To Disable The Module In 2 Cases, Either Total Swap Size Is Zero Or Total Memory Size (RAM) Is Less Than 2 GB.

Edit1: We Can Also Use

which swapoff

Command To Get The Complete Path For Ex.

/system/bin/swapoff

.

Edit2: The Modified Module Has Been Tested Successfully On Nougat Rom & Pie Rom.
[Magisk] EarlyMon:
Ah, I don't have an A/B phone, good point.

However, note earlier that the module has been working properly with Pixels, so... Not sure if they include a legacy link or what.

Please see my edited post above (didn't see your reply, my bad) about the path treatment.

I would have expected the Magisk internal busybox (first in the path) to hook into the kernel the same as the distributed system version in any case.

At the same time, I wanted the system version first. I didn't have a reason for that beyond aesthestics and robustness when I did that - the default worked for me. (edit - the which would just elaborate the original else clause - I would expect the subshell to inherit the path - I better re-check that)

I'm somewhat afraid of using pgrep for the test - users have driven the length of the timeout and there are obviously some weird cases out there. Even if zram isn't ready in 45 seconds for the corner cases, I'd be really surprised if com.android.phone or something isn't running by then. If true, swapoff would run prematurely and fail.

Very interesting suggestion about the 2 GB clamp!

Again, your thoughts are welcome in advance on the above - and I really appreciate the collaboration. :)
[Magisk] EarlyMon:
Here's the subshell path -

/sbin/.core/busybox:/sbin:/system/sbin:/system/bin:/system/xbin:/vendor/bin:/vendor/xbin:/system/vendor/bin:/system/vendor/xbin:/product/bin:/product/xbin:/odm/bin:/odm/xbin

So *which swapoff* isn't going to help.

If anything, the -f ought to be a -x and I distinctly remember thinking about that at the inception. No idea why I left it -f. Hmmmmm....

Edit - if /system_root/system works then that suggests a defect in the Magisk path. And the Magisk path looks like it just prepends the vendor path so I will be very surprised if that's the case. The Magisk path may be its own thing.

And /system_root/system is supposed to be a symlink to /system, not a replacement mount point. Note - "supposed to be."
[Magisk] Dreamer(3MF):
To Be Honest With You, I Am Just A Beginner In Coding. And I Am Interested In Modifying/Creating The Modules For Magisk.

As Magisk Has Its Built-In Busybox & The Required Functions Can Be Done Thru It So What Do I Need Else?

P.S. The Modified Module Has Been Tested Successfully On Nougat Rom & Pie Rom Too.

P.S. I Don't Have An A/B Device To Test The Suggested Path But I Found It In Another Module.
[Magisk] EarlyMon:
[MENTION=7258437]5amar31[/MENTION] Please try this one and let me know, thanks!

View attachment 4625979

[MENTION=9018566]Dreamer(3MF)[/MENTION] If you don't have an a/b device then it's working with the default path swapoff - which may be the final answer, we'll see.
[Magisk] 5amar31:
Mi A1 is A/B device. Which version should I test then?

Edit: The one you have attached didn't work.
[Magisk] 5amar31:
Shows /system in file explorer for me.
[Magisk] Dreamer(3MF):
Did You Test Swap_Torpedo-v1.1B(Test).zip From This Post https://xdaforums.com/apps/magisk/module-swap-torpedo-run-faster-reliably-t3766883/post77961035 & Also Swap_Torpedo-v1.1A(Test).zip From This Post https://xdaforums.com/apps/magisk/module-swap-torpedo-run-faster-reliably-t3766883/post77958631?
[Magisk] 5amar31:
None of them worked.
[Magisk] EarlyMon:
I'm not surprised.

I'll need to check on some other things and get back to you.

Many thanks for the testing help, it matters! :)
[Magisk] blackhawk_LA:
I have the module installed and it's working; ramtruth shows 0 swap size.

However, I've noticed thatI have the process "kswapd0" still running most of the times. Is it normal?
[Magisk] balachis:
Hi,

I've tried and installed Swap Torpedo module from Magisk v17.1. I'm using Huawei P9 Lite VNS L-31 and this is what I get from Truth Ram. After the flash and reboot, my phone swapspace becomes 0.

May I know whether Swap Torpedo worked or not? :o
[Magisk] DanGLES3:
If swap shows as 0 then swap torpedo is working properly
[Magisk] balachis:
Thank you so much DanGLES3 ;)

Now, I think I need to learn some linux base command and understand it's structure but as for now I've got only su for enabling superuser :confused:
[Magisk] afr33sl4ve:
Hey, not working on the LG G5 with the first Oreo release. All stock, and rooted.

Oh, if it shows 0 in swap it's working. Can't delete posts. :/
[Magisk] MArtyChubbs:
Works, TY! View attachment 4628613
[Magisk] nkirk:
[MENTION=2682748]EarlyMon[/MENTION] thanks for this. Works very well. V20 user here.
[Magisk] Dreamer(3MF):
Check The Attached Modified One.

Edit 1: To Our Mates, Kindly Check The Following Points

- The Target Of Swap Torpedo Is Swap (Total) To Be 0 [You Can Check That Either By Downloading RAM Truth From PlayStore Or Using The Command Of

cat /proc/meminfo

From Terminal Emulator]

- Download It From This Post https://xdaforums.com/apps/magisk/module-swap-torpedo-run-faster-reliably-t3766883/post78277160
[Magisk] 5amar31:
That worked. Thanks a ton.

Edit : One weird thing happened though. I had Google Sans font installed using Magisk before installing this. Now after installing this the font has switched back to Roboto. Even tried rebooting but still on Roboto.

Edit 2: All my previous modules have stopped working a actually.

Edit 3: I even tried reinstalling my other modules but they still didn't work. Now when I have disabled Swap Torpedo all modules are working fine.
[Magisk] Dreamer(3MF):
Try The Amended Modules In The Previous Post. Awaiting Your Feedback.
[Magisk] 5amar31:
OK the DL one removed Swap without affecting other modules. What's changed on the DP version? Which should I keep installed?
[Magisk] KOLIOSIS:
Just wanted to share this from my unrooted T-Mobile OnePlus 6T,as it's showing 0 Swap out-of-the-box:

Guessing RAM is used differently in Android Pie &/or by OnePlus,IDK..........
[Magisk] Dreamer(3MF):
You Need To Keep Installed DL Version But FYI Some Issues Which Are Related To Magisk/Rom/Kernel Itself Can Be Solved By Using A Different Versions Of The Module.
[Magisk] zoel.fahmi:
NOICE

my phone become faster than before

---------- Post added at 04:35 PM ---------- Previous post was at 04:33 PM ----------

8 GB RAM, you don't need swap memory at all

Beside you're running on AOSP
[Magisk] KOLIOSIS:
Admittedly,the subject is a bit over my paygrade.,LOL.

It's just that I've never seen 0 Swap on a stock/unrooted phone before,even on my Sony XZ Premium & XZ2,so,I thought I'd share with the crowd.

By comparison,Oppo's Find X & Vivo's NEX ,both 8GB RAM phones,have a massive amount of Swap (I posted screenshots a couple months ago).

So yes, absolutely,as you've stated,not all RAM is apparently created equal,so to speak, I appreciate the input.

Have a Great Weekend! :svetius:
[Magisk] zoel.fahmi:
The heavy customization on Sony or Oppo and vivo also Samsung is beyond believe

Heavier than the heaviest cusrom (resurrection remix)

So yes, they're gonna need more memory

Also, I suspect the premature ROM
[Magisk] Dreamer(3MF):
To Our Mates, Try The Modified Module From This Post https://xdaforums.com/apps/magisk/module-swap-torpedo-run-faster-reliably-t3766883/post78039462 & Send The Feedback.
[Magisk] EarlyMon:
Sorry for the late reply.

Swap Torpedo doesn't include anything that will modify the system to threaten passing SafetyNet.

No need to worry about the kernel swap daemon running normally.
[Magisk] EarlyMon:
This appears to be the relevant change -

alias SYSBC='getprop sys.boot_completed'

while [ ! "`SYSBC`" = "1" ]; do
sleep 5
done

This is the release candidate with that idea incorporated -

View attachment 4633668
[Magisk] 5amar31:
I figured out the issue why it wasn't working on my A1. This module(even the modified ones) doesn't work with Secure Startup enabled. v1.1 in the Magisk Repo works just fine. No need of modifications. [MENTION=2682748]EarlyMon[/MENTION] Add this to OP.
[Magisk] balachis:
Hi,

This swap torpedo can only be used under Magisk rooted devices right?

I've changed my ROM.. I'm using Elite ROM with K Framework and SuperSu, are there other swap torpedo that I can use with this ROM?

P9 Lite VNS L-31
[Magisk] Nerva:
What are people's experiences with this on the Samsung Galaxy S5? I've been frustrated with Google Maps being in particular, but many smaller apps seem to take an unusually long time to load.
[Magisk] nkirk:
You might want to tweak LMK settings.
[Magisk] DaRdamnDoG:
Mine shows zrero does it mean I can't use this module?
[Magisk] Dreamer(3MF):
You Can Use The Attached Modified Module Of Swap Torpedo With SuperSU/Lineage-AddOnSU/Magisk/Any-Rooting-Tool & Do The Following

- For Installing The Module: Flash It Thru TWRP Recovery

- For Removing The Module: Reflash It Thru TWRP Recovery

- Download It From This Post https://xdaforums.com/apps/magisk/module-swap-torpedo-run-faster-reliably-t3766883/post78277160
[Magisk] Dreamer(3MF):
The Target Of Swap Torpedo Is Swap (Total) To Be 0 [You Can Check That Either By Downloading RAM Truth From PlayStore Or By Using The Command Of cat /proc/meminfo From Terminal Emulator] So If Swap (Total) Is Zero Before Flashing The Module, It Means You Don't Need It.
[Magisk] DaRdamnDoG:
I see. So ithe module is working for me then. :) Thanks
[Magisk] balachis:
Thanks Dreamer

I've flashed the zip that you gave me

Now, does it work?

Attached: Screenshots of "cat /proc/meminfo" and Ram Truth

Thanks again :)
[Magisk] Dreamer(3MF):
Yes, It Works Properly.
[Magisk] balachis:
Thanks Man :D :D

4 a.m. here, I really need some sleep now..

catch ya later ;)
[Magisk] DaRdamnDoG:
Unfortunately after using for a few hours my phone is having screen freezes and after uninstalling it got to normal again.
[Magisk] Dreamer(3MF):
For Getting Better Performance/Effect, Use The Module For Any Device With RAM More Than 2 GB.
[Magisk] Nerva:
So... the Galaxy S5 has 2GB of RAM -- does that mean I should use it or I shouldn't?
[Magisk] iZLeeP:
Using this module on a Huawei Y6II with 2GB of RAM, and it works like a charm. UI and apps are more snappy.
[Magisk] Nerva:
Thanks -- I'll keep using it.

Is there a Magisk module or something for doing that? I just googled LMK settings and found some discussion of it, but I didn't see anything on how to actually go about tweaking the settings.
[Magisk] DanGLES3:
Use an app like kernel auditor to tweak LMK (Low Memory Killer)
[Magisk] Jordan~Kurniawan:
I have 3gb of RAM

everything does feel a lot smoother when i installed this module

no more UI hiccups etc.

but whenever i minimized my game (Ragnarok Mobile) and open more app (whatsapp) the game always gets closed

does that mean my RAM is insufficient?

because when i disabled this module it doesn't get closed as often

any help would be appreciated

because i like using this module.
[Magisk] DanGLES3:
You can try tweaking the low memory killer to be less aggressive using kernel auditor
[Magisk] zoel.fahmi:
Mind to guide us?