[MOD] [Magisk Module] [Universal] Swap Torpedo - run faster (2018-3-20)

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,281
0
This is a new Magisk Module awaiting processing for inclusion as an official download.

Seeing as how I developed it on the honor View 10, I thought I would give fellow honor owners the first opportunity to try it. (Update - now in the Magisk forum)

Let's take a look -

Screenshot_20180317-044913.jpg Screenshot_20180317-045022.jpg

It makes no sense to use 500 MB of swap with 3 GB RAM free!

(Note - we're going to update RAM Truth - the swap type used on the honor is zram.)

So here you go -

Swap Torpedo - A Magisk Module

Universal compressed-memory swap (zram, etc etc) destroyer - run faster and more reliably!

By EarlyMon - version 1.0

Swap is a way to expand your RAM using clever software and some unused storage space. You see it a lot in Android as zram or vmswap.

Swap is a fine thing for desktops with sufficient resources and for Android devices really hampered with too little ram.

It was originally intended for devices with less than 1 GB RAM.

If you have an Android One or another small-memory device, this is NOT the module for you.

But if you have 2 GB of RAM or more, you want this.

Do you suffer from lag, random UI pauses, apps not running correctly and consistently, and background apps failing even when you have them marked for protection? Do you have to reboot every day or so to restore speed?

All of that is almost always caused by having swap implemented and the Swap Torpedo fixes it.

Manufacturers, including Google, have fallen in love with swap because it allows your Android to synthetically appear better at multitasking. In reality, it ruins multitasking.

Why? For large memory devices you want the swap space to be at minimum the square root of your RAM size and ideally the same size as, or up to double the size of, your RAM.

The problem is that they don't use enough space because they can't - they're basically using a compressed RAM disk as a swap partition.

If you think about that, it will raise the right questions.

Does it make sense to use RAM for something other than apps and the operating system? Does it make sense to constantly have the operating system pause while it shuffles and reorganizes your RAM? Does it make sense for you to wait on everything while various pieces of RAM are getting zipped and unzipped to support this scheme? Does it make sense to do all of that incorrectly in the first place because you can't get enough swap space to properly support multitasking, by design?

No. No it does not.

Swap Torpedo is the answer.

I designed it to be universal for any Android that Magisk version 15 and above supports. If you're not using swap, or if you installed your own swap solution that writes to a special file in storage, Swap Torpedo harmlessly does nothing.

Verify your swap situation with RAM Truth available on the Play Store. It's free and it will never spy on you or ask for special permissions.

Donations are humbly and gratefully received at [email protected] but not expected. My personal reward is knowing that I helped and you are having a better day now.

This module was developed entirely on an honor View 10.


Changelog -

v1.1 - 2018 April 1 - functional update

More phones supported now, maybe all

v1.0 - 2018 March 17 - initial release

Set minimum Magisk to 15

Download -

Magisk forum: [MODULE] Swap Torpedo - run faster and more reliably

https://forum.xda-developers.com/apps/magisk/module-swap-torpedo-run-faster-reliably-t3766883
 
Last edited:

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,281
0
Notes and other orthodontia -

Don't try to flash this in TWRP until data decryption is working. FlashFire definitely doesn't work.

Magisk Manager only.

Magisk v16 or better required.
 
Last edited:

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,281
0
I had the following problems on my hv10 -

My external DAC/amp wouldn't work reliably.
Music players would hang in the background, regardless of how I protected them.
I have a lot of apps - I couldn't fling to the bottom in the EMUI app drawer and what I could was always interrupted by a lag spike.
I would have to reboot my phone every few days to get it to run faster again.

Swap Torpedo fixed all of that for me.

You don't need swap/zram on a phone with this amount of RAM.
 

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,281
0
Have it running, but don't notice any difference right now.
It issues a single command at the end of the boot initialization - in the case of a Huawei or honor -

swapoff /dev/block/zram0

Just to clarify that nothing is running - in fact, if your rom was using swap, now it's running fewer processes.

Are you on EMUI or a custom rom? If custom, did you verify if it had swap implemented first using RAM Truth or equivalent?
 
  • Like
Reactions: DeeZZ_NuuZZ

DeeZZ_NuuZZ

Senior Member
May 16, 2012
11,494
4,548
253
25
Hanover
It issues a single command at the end of the boot initialization - in the case of a Huawei or honor -

swapoff /dev/block/zram0

Just to clarify that nothing is running - in fact, if your rom was using swap, now it's running fewer processes.

Are you on EMUI or a custom rom? If custom, did you verify if it had swap implemented first using RAM Truth or equivalent?
I'm on EMUI
 
  • Like
Reactions: EarlyMon

DeeZZ_NuuZZ

Senior Member
May 16, 2012
11,494
4,548
253
25
Hanover
I will be keeping an eye on the RAM and how good multitasking is. for now it is a little bit better than before, but nothing special. but I gonna try and play few games and see how it is
 

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,281
0
I will be keeping an eye on the RAM and how good multitasking is. for now it is a little bit better than before, but nothing special. but I gonna try and play few games and see how it is
I wouldn't expect multitasking improvements in terms of running more apps but I would expect better stability multitasking.

I would expect better stability and less lag overall.

Others have consistently reported gaming improvements in performance with this mod over the years.
 
Last edited:

DeeZZ_NuuZZ

Senior Member
May 16, 2012
11,494
4,548
253
25
Hanover
gaming is the same without and with that mod. actually I tried asphalt 8 again and it's still so super bad optimized, that even the kirin doesn't run on full speed with this game... also some other, really "light" games are lagging here and there... very strange. and this mod sadly didn't help :(
 

BoGnY

Senior Member
Aug 29, 2014
64
18
0
31
Treviso
Hi, I've tried to install your module, but I get the error "Installation failed: Please install Magisk v15.0+" but I have Magisk v15.4 installed and enabled..
Maybe a problem on installation script???
Thanks
 
  • Like
Reactions: EarlyMon

DeeZZ_NuuZZ

Senior Member
May 16, 2012
11,494
4,548
253
25
Hanover
Hi, I've tried to install your module, but I get the error "Installation failed: Please install Magisk v15.0+" but I have Magisk v15.4 installed and enabled..
Maybe a problem on installation script???
Thanks
Either re install 15.4 or even install v16.x I often had this issue with modules too, magisk was running fine but the modules couldn't detect it, a re-install or update fixes that

Sent from my HUAWEI BLA-L29 using XDA Labs
 

EarlyMon

Senior Member
Jun 23, 2010
1,685
1,281
0
I can't install v16 as @topjohnwu says that only v15.4 is compatible with honor view 10...

I think I have to wait :D
I wasn't thinking, I have a test release of 8.1.

I'd set the minimum Magisk to version 16.

Nothing in the module ought to have any trouble with your version of Magisk.

Give this one a try! :)

(edit - see first post for updated download)
 
Last edited:
  • Like
Reactions: DeeZZ_NuuZZ

BoGnY

Senior Member
Aug 29, 2014
64
18
0
31
Treviso
When did he say that? I have v16.1/2 on my mate 10 pro running fine
I have read it on his thread about rooting honor view 10: https://forum.xda-developers.com/ho...agisk-root-honor-view-10-mate-10-pro-t3749280

I wasn't thinking, I have a test release of 8.1.
I'd set the minimum Magisk to version 16.
Nothing in the module ought to have any trouble with your version of Magisk.
Give this one a try! :)

View attachment 4453109
Thanks a lot, I test it immediatly ;)
 
  • Like
Reactions: EarlyMon
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone