yashsingh1/xdaforums huggingface dataset:
[Magisk] EarlyMon:
[MENTION=2172164]flipmode_11[/MENTION] - Not much I can tell you but I'll try. A lot of this is off-topic but I have a minute. :)

Most of the ultra cheap TV devices aren't worth it and specs mean nothing. I have a first gen Fire TV Stick with a 1 GHz dual core and 1 GB RAM and the cheapest Roku Express with a 900 MHz CPU and 512 MB RAM. The Roku is better. To improve performance, get a better Roku. It's TV, don't mess with it. Others will disagree but I say, get something that works right and ignore the specs.

If you get an 800 MB Android phone, do what [MENTION=5488402]Davey126[/MENTION] did and add file-based swap if it's not working properly. Otherwise ignore the specs.

Leave the VM parameters alone and leave the partitions alone. Ignore the specs.

I have four phones that I use almost daily, they run the entire range of hardware. One of my favorites has 3 GB DDR3 RAM with a balanced overall design (despite a low end processor) running a good ROM. Ignore the specs.

Good luck with your decision! Choose something that seems to work pretty good for you - and ignore the specs. I hope that the Swap Torpedo can help if it needs it. :)
[Magisk] flipmode_11:
Thanks mate, really appreciate your time! :highfive:

I just thought that it was worth thinking about the other end of the market that have only 1 GB of memory.

I totally agree with you [MENTION=2682748]EarlyMon[/MENTION]. Used eBay to get x96 advertised with 1GB ram, just to get something basic and to test. In fact the H96 RK3328 is far worse and problematic than the x96 S905x.

Yeah I think your Roku is optimised for the specs better than the Amazon. The S905x was advertised as 2GHz 1GB/8GB, but it only was 1.5GHz 812MB/4.2GB. I understand the 4GB of the OS, but the rest is unacceptable.

So surely something could be done with Swap Torpedo to optimise these budget devices with low specs?? (Maybe similar to the developer option to keep only x background processes, or do not keep activities, etc. (Do Not Keep Activities checkbox.) - so when you close the app it is terminated (or limit to couple recent apps) and you don't have 50+ background apps sucking RAM and CPU).

I'd forgotten about this and is probably viable.

Just like optimising device settings and config for 4GB to 8GB devices, can the opposite not be done for 1GB devices??? (which are actually 811MB!)

So, not off topic, just thinking in the opposite direction to optimise cache and swap etc - the opposite of what you do currently. :silly:

Thanks mate :good:

P.s. Plat advise you recommendations for small box settings instead of high-spec device.

Cheers!
[Magisk] EarlyMon:
[MENTION=2172164]flipmode_11[/MENTION] Important to remember that devices reserve RAM by design.

Unlike a box that you can plug in a graphics card carrying its own RAM, a device gets it all from the motherboard.

It's a matter of bookkeeping.

Your operating system may show 811 MB on a 1 GB device but the difference didn't disappear - in a way, you're basically looking at it when you use the screen.

The part that seems missing is serving the GPU and some of the IO ports. It's there. You're still using it. It's just not listed.

Other operating systems in the past have shown that inside the full RAM listing - but you would have zero extra RAM for apps or anything else. See what I mean by bookkeeping?

It's just bookkeeping. You're using it. By example, you can take a hand and call it your left hand, or your hand that's not your right - but it comes down to the same thing.

It's ok - the GPU and other hardware need what they need.

PS - maybe this is a better example -

How many fingers are on the standard, regulation hand? Four fingers and a thumb? Ok. Or five fingers, one of which is a thumb? Ok. So the answer can truthfully be four or five and nothing is wrong.

The reserved GPU and IO RAM isn't missing - that's the thumb.
[Magisk] ikramsopee:
RAM Truth [ 3 GB ]

Reserved: 376.62 MB

User: 2695.38 MB

Active: 1672.26 MB

Available: 1023.11 MB

Hibernating: 772.00 MB

Idle: 251.11 MB

Swap (total): 512.00 MB

Used (storage): 52.75 MB

Device Info:

Android: 8.1.0

Device: gemini

Model: MI 5

Maker: Xiaomi

RAM Truth: v1.4

It still stays the same even after i did do the cmd cat /proc/swap*
[Magisk] EarlyMon:
I need to see the output from cat /proc/swap* please. :)

What version of Magisk are you using?
[Magisk] DB126:
[MENTION=2172164]flipmode_11[/MENTION] - two thoughts:

- ignore the specs (hum, heard that before somewhere ...)

- mind your LMKs

- bonus thought: keep it simple

I have doing so called "low end" gizmos for years enjoying both the value and making supposedly inferior hardware sing. It isn't hard provided you have root access (ideally an unlocked bootloader) and reasonable expectations around the ultimate outcome. Excessive tinkering is a fool's errand if you value your time.

DDR3 vs DDR4 is irrelevant from from a real world perspective. My daily driver is 4 years young rocking 2 GB 800 MHz DDR3 that toasts most contemporary devices despite dismal benchmark scores. Yep - it'll wilt in a gaming scenario but kicks tail with smooth response in daily multitasking.

Too much OT. There are tons of enthusiast threads dedicated to dealing with low-end device optimization. Keep that bonus thought in mind.
[Magisk] ikramsopee:
gemini:/ $ su

gemini:/ # cat /proc/swap*

Filename Type SizUsed Priority

/dev/block/zram0 partition 524284 109048 -1

gemini:/ #

Sorry, i cannot upload the screenshot.

Btw, im using magisk 5.7.0 (115)
[Magisk] EarlyMon:
Thanks for the cat!

That's your Magisk Manager version, the Magisk version is on the front page (picture below) - I'm on 16.0.

I see you're on the latest Manager - if you're on the latest beta - 16.4 - that's a problem. If so, please zip and link to the upload of your /data/adb/magisk_debug.log and post the link here, if you have time.

If you are on 16.4, you need to go back to a previous version.
[Magisk] ikramsopee:
Hahaha sorry my bad. Yeahh, im using magisk v16.0

Here, the zip file

https://drive.google.com/file/d/1gAwz2qw45yDWueDvNtWpMyzHrxuV1VWQ/view?usp=drivesdk
[Magisk] EarlyMon:
Thanks for the log! Swap Torpedo started correctly, but obviously, didn't work.

Please try this one - if you still have swap, please see if you have a /cache/noswap.txt file left behind.

If you do, please give me a little bit to prepare the next test ok.
[Magisk] ikramsopee:
I have flash the zip file

But, theres still swap storage of 512 mb

And, there isnt any path to /cache/noswap.txt

This is the cmd screenshot: https://drive.google.com/file/d/1rCWECRIqJrIByA4E2wOURKRGPpCwExIk/view?usp=drivesdk

Here is the new zip file for magisk debug log : https://drive.google.com/file/d/15pCM7g4Fvuifk2ZgYXIode1vWO3nkWI_/view?usp=drivesdk
[Magisk] EarlyMon:
There will be on this one - please tell me what the /cache/noswap.txt file says, thanks!

(Needs root to view it.)
[Magisk] flipmode_11:
[MENTION=5488402]Davey126[/MENTION]

Thanks again guys. You are both really knowledgeable!

Was just trying to confirm this would still benefit a device with so little slow RAM. :)

I'll give it a whirl. Cheers mate! :good:
[Magisk] ikramsopee:
https://drive.google.com/file/d/12BM6X7kBwzdRhDldh4qVjey5fxJt5g3i/view?usp=drivesdk

This is the noswap.txt
[Magisk] EarlyMon:
Thanks! Let's see about...

Be sure to check for no swap first, if it's still there, give it a few minutes and try again, see if it's going down, repeat as necessary, thanks!

PS - are you on the stock rom?
[Magisk] ikramsopee:
Okay will do. I will tell you the result :fingers-crossed:

Im using lineage os 15.1 (newest update)
[Magisk] Hai Karate:
Just wanted to post an update on this... I've installed the official Oreo release for the S7 and it doesn't have this issue. Swap Torpedo works fine under Magisk 16.4.
[Magisk] ikramsopee:
I'd flashed the new zip file 3 times already. Unfortunately, there's still noswap.txt in the /cache and theres still 512 mb of swap :(
[Magisk] EarlyMon:
I left the text file on purpose, no big deal for now.

Two things to try -

First, immediately after boot, open a terminal, su, and then

swapoff /dev/block/zram0

Normal behavior: it's going to seem like it's hung up doing nothing, even for ten minutes or more. Leave it be and check swap with RAM Truth every two minutes to see if the USED swap is going down.

If the terminal spits out an error, please show me.

If it behaves normally and even gets rid of swap, please let me know.

Second, after that -

Remove Swap Torpedo, try Kernel Adiutor - goto Virtual Memory, apply on boot, slide zram to zero - goto settings and reduce the time after boot to something less than ten seconds - try one second first. Reboot and let me know.

PS - did Swap Torpedo work on previous 15.1 builds? I know that Swap Torpedo is ok with other phones with the official LOS 15.1.
[Magisk] EarlyMon:
I left the text file on purpose, no big deal for now.

Two things to try -

First, immediately after boot, open a terminal, su, and then

swapoff /dev/block/zram0

Normal behavior: it's going to seem like it's hung up doing nothing, even for ten minutes or more. Leave it be and check swap with RAM Truth every two minutes to see if the USED swap is going down. Don't do anything else during the wait please.

If the terminal spits out an error, please show me.

If it behaves normally and even gets rid of swap, please let me know.

Second, after that -

Remove Swap Torpedo, try Kernel Adiutor - goto Virtual Memory, apply on boot, slide zram to zero - goto settings and reduce the time after boot to something less than ten seconds - try one second first. Reboot and let me know.

And go ahead and remove the /cache/noswap.txt if you want.
[Magisk] ikramsopee:
After im using the terminal code, it works. The swap becomes zero. :fingers-crossed:

For the kernel auditor, it just stays the same. 512 mb of swap still there

Thanksss :good:
[Magisk] EarlyMon:
Did it take very long from the terminal?

:eek: :confused:

Ok, how about this from the terminal, with su, when swap is gone -

which swapoff
cat /proc/swap*

What does it say?
[Magisk] koolkunz:
How can I acheive what this module does without Magisk I use SuperSU because some of my banking/payment related apps don't work with Magisk hide..I am using an S7 Edge on latest Oreo.

I tried using kernel aduitor and setting zram to 0 but it is already zero.
[Magisk] EarlyMon:
Does your /system/etc/init have a collection of files ending in .rc?

Unzip this and put the noswap.rc there.

If not /system/etc/init then look around for similar directory and put it there.

Make owner and group both root, set permissions to 644.

Let me know if it works or if any questions. :)

Check your banking and/or safetynet - this is NOT a systemless mod.

PS - on Kernel Adiutor, you turned on the apply on boot switch, yes?
[Magisk] ikramsopee:
It only took about 2 seconds for the terminal to go back normal, and bam the swap becomes zero. ;)

Heres the screenshot of :

Which swapoff

Cat /proc/swap*

https://drive.google.com/file/d/12sXzMmGQOln1ANGJ_loyGC5At8T5jy7a/view?usp=drivesdk
[Magisk] EarlyMon:
(Thanks for the info!)

And what you have going on is completely mental! :D

What you have - is what Swap Torpedo does. :eek:

I'll be honest, I need some time to think carefully about this one.

Terminal Emulator, similar, or adb shell for the terminal?

Please use the terminal in the meantime...
[Magisk] ikramsopee:
Its terminal emulator. Okaay, thanks again! :angel:
[Magisk] EarlyMon:
I can't resist...
[Magisk] EarlyMon:
So, a different sepolicy stack and then you feel better! :D
[Magisk] koolkunz:
there is a collection of .rc files there and despite putting the noswap.rc file there with correct permissions... Swap is still there..

And yes I did turn on apply on boot in kernel aduitor..

But I have systemless root is that why it doesnt work ?
[Magisk] EarlyMon:
Systemless root is not the issue.

An unfortunate difference in how our Oreos handled that rc file. Be sure to remove it then.

The only other suggestion I have I don't have much faith in but it wouldn't hurt to try. Add a script to init.d using Kernel Aduitor that contains -

#! /system/bin/sh
swapoff /dev/block/zram0

Be sure to reduce the Kernel Aduitor wait time down to a second in settings.

Let's confirm first from a terminal as root -

cat /proc/swap*

And let me know what that says to be sure.
[Magisk] koolkunz:
This is what that command gives

So I guess instead of

/dev/block/zram0

I need to use

/dev/block/vnswap0

?
[Magisk] EarlyMon:
Yes.

I'm an idiot for not asking first, you specifically said that you had a Samsung. :(

Definitely replace as you noticed - I'd try the noswap.rc fixed first, if no luck, try the init.d trick with the change.
[Magisk] koolkunz:
fixing the noswap.rc file didnt work.. but the init.d command using kernel aduitor worked .. thanks :D
[Magisk] EarlyMon:
Fabulous, glad we sorted it out. :)

You probably know, but a friendly reminder, don't leave the rc file behind. ;)
[Magisk] koolkunz:
yeah deleted it..
[Magisk] Salvador Abundez:
No problem here with Helios Rom 7.27 (Nougat) also used on the Oreo releases and working perfectly model SM-G935F
[Magisk] EarlyMon:
Super - enjoy! :)
[Magisk] hairycheez:
This is awesome!
[Magisk] :
Amazing module making my phone running so much faster and smoother and multi tasking is a beast. This unleashes the power of my phone.

Samsung Galaxy S9 International SM-960F
[Magisk] EarlyMon:
[MENTION=4198717]hairycheez[/MENTION] [MENTION=4735365]nosar77[/MENTION]

Glad you like it! :svetius: :svetius: :)
[Magisk] Guilhermex12:
I wanna try this but i have a Magisk Module called "RAM Management fixes by crok" Can they conflict?
[Magisk] Intelli69:
Thank you for this!
[Magisk] EarlyMon:
Happy to help, cheers! :)
[Magisk] EarlyMon:
Among other things like changing the minfree/LMK parameters, it changes some of the parameters that won't matter once you include the Swap Torpedo.

If it were me, I'd try each one separately and see how that goes.
[Magisk] Guilhermex12:
Alright man, i'll try, ty :)

Edit: looks like it's working!

Lineage OS with Android Oreo on my J7 2016
[Magisk] KUSOsan:
[MENTION=2682748]EarlyMon[/MENTION]

Just wanted to say thanks for the work and the info. I used to get into tweaking all sorts of parameters and tweaking every aspect of custom kernels (including messing with the swap sizes and VM) and stuff back in the days of the Galaxy S4 and I got to the point where I just lost interest and gave up from frustration due to lack of results. Just saw this on a magisk module article and it peaked my interest again after just now getting into magisk and I gotta say it has made a noticeable difference on my LG V20 (using SuperSU + kernel aduitor). Was using about 1GB of swap before and now it actually switches from app to app almost instantly without hiccups.

I have a Nexus 6p that I'm using for experiments (mainly with magisk) and the module worked flawlessly. ?
[Magisk] EarlyMon:
[MENTION=5359858]KUSOsan[/MENTION] Glad to hear it! :)
[Magisk] MrPhilo:
This module just disables swap/zram right?
[Magisk] EarlyMon:
Basically, yes. :svetius:

It turns off any swap declared in a dedicated /dev partition - to date the only such swapregions in Android are compressed-ram methods such as zram (typically) or Samsung's competing vnswap. If another ever comes along, the Swap Torpedo will shut it off as well.

Apart from bookkeeping and housekeeping (to keep with the zram spec for phones that care about it, and not all do), it runs the swapoff command and terminates - until relaunched at the next boot *only*.

No permanent changes are made, it's systemless thanks to Magisk, and if you decide to uninstall it, it will be as if it was never there.

It does NOTHING to your VM parameters so if you want to install a file-based swap and set your own parameters, the Swap Torpedo will stay conveniently out of your way, just as it ought to do.
[Magisk] Prattham:
Does this has any effect on battery life? Good or bad?
[Magisk] EarlyMon:
Many report battery improvements - the compression/decompression task loading is gone.

Others report no changes or a little worse - with more ram for apps, you may get more running in the background than before.
[Magisk] freestyle_89:
sorry my english is bad I use android 6.0.1, after installing this module my phone runs smoothly and lasts more than half an hour, thanks for your work very much [MENTION=2682748]EarlyMon[/MENTION] :)
[Magisk] EarlyMon:
I'm happy you like it. :)
[Magisk] Eng.Raman:
It doesn't work with my zenfone 3 ( ze520kl ).
[Magisk] EarlyMon:
Thanks for the feedback and the log!

It installed and ran so let's check -

Are you running Tasker, Greenify, or any other job controller?

Did you get it from the first post or through the Magisk Manager?

Can you show me the terminal output, su first, of -

cat /proc/swap*
[Magisk] Eng.Raman:
Never use tasker or greenify or any job controller.

I get it from the 1st post and installed via magisk manager.
[Magisk] EarlyMon:
There’s a minor update that may help - I need to update the first post. Try this please.
[Magisk] Eng.Raman:
Installed but nothing changed, ram truth still show Swap ( total ): 640.00 MB. :rolleyes:
[Magisk] bggold:
Earlymon I have a question what is the difference between your module and turning zram off in ElementalX kernel?

Thanks
[Magisk] EarlyMon:
Appreciate your retry.

Uninstall the module, try setting zram to zero at boot with Kernel Adiutor - and in its settings, change the start time from 10 seconds down to 1, and let me know!
[Magisk] EarlyMon:
A kernel mod ought to always be more efficient as a rule of thumb.

Swap Torpedo is as universal as I've been able to make it. Phones without a kernel choice for zram can use it and it only costs a few extra seconds at boot, if that.
[Magisk] bggold:
Thanks for the info. Very helpful.
[Magisk] Eng.Raman:
Swap total show 0.00 MB with kernel adiutor installed.
[Magisk] EarlyMon:
The problem is that not all phones follow the zram spec (actually few do).

That leads to the need for various solutions honed from user feedback. For the majority of cases there's no difference in zram results between Kernel Adiutor and the Swap Torpedo. For the remainder, Kernel Adiutor can sometimes cover things that the Swap Torpedo cannot and vice versa.

Both tools are open source but I won't copy his just to say that I can. It's not a race, our approaches are a little different, and there's no point in breaking anything trying to unify them.

As I said in the second post - you have to go with what works for you. :)

Thanks for trying the Swap Torpedo and especially for working with me on this!

You may find other things that you like in the Kernel Adiutor as well. I certainly did and donated to his work, it's a great app!
[Magisk] Eng.Raman:
Ok bro, thanks alot for your replies. :)
[Magisk] :
Hi EarlyMon,

Thanks again for this great module! It's been running well on my Nexus 5X. Is this version you just posted more up to date than the Swap Torpedo 1.1 on the Magisk Repository?
[Magisk] EarlyMon:
It's exactly the same as what's on the repository.

After weeks of success, one user needed more than the 45 second maximum wait time for swap to settle down, so I gave him a 60 second wait and updated the repository immediately. That was exactly three weeks ago.

It could be argued that canonically I ought to force an update for everyone over that but I decided that the corner case wasn't worth everyone's extra effort.

I absolutely ought to have updated the first post though and I promise that I will asap. :) In my mind, I updated the first post that day but in reality, I got interrupted and forgot.

If you're on a newer, faster phone, your wait time will be zero seconds - and if you're not, I'm not adding 60 seconds to the boot time, I'm simply waiting as long as needed, up to the 60 second maximum, for the phone to settle out and complete the full boot stack.

PS - Glad you like it. :)
[Magisk] roger.hernandez91:
So I'm on a stock rooted LG G6, my system might be a little corrupted cause whenever I install a Magisk mod, all my processes will start quitting after rebooting (I also get errors that /system can't be mounted) but wiping Dalvik and cache and going through a few boots fixes it and everything settles down. Everything is working.

You think I'll be okay to try this? Just in case, if I get stuck in a bootloop or can't boot, can I uninstall by flashing the zip again in recovery? (I'm on TWRP)

I appreciate your work and help.
[Magisk] EarlyMon:
I never believe that any mod is worth chancing that something can get worse and lead to a brick - and that part where I stopped is a red flag for me.

However - an app could be less risky in your case until you get your phone squared away.

Kernel Aduitor, choose Virtual Memory, slide zram to 0 and apply on boot, and then back to settings, change start delay from 10 to 1 seconds.

But your best bet in my opinion - go to the G6 forum and seek help from other G6 owners before you do anything.

From your description, zram is the least of your worries right now.

Good luck, let me know! :)
[Magisk] roger.hernandez91:
Hey man. I fixed my device up, long stort short fixed my recovery and magisk and am not having any of the previous corruption issues. I installed your mod and will let you know how it goes! Thanks!
[Magisk] EarlyMon:
Right on and my pleasure! :)
[Magisk] Adzkii:
ram truth is showing swap (total) after installing this mod but on kernel adiutor is showing 510MB ZRAM, when i try to change it to 0, it reverts back to 510. is it all fine or am i missing something here?
[Magisk] EarlyMon:
If RAM Truth is showing Swap (total) 0 then it's fine - and don't use that Virtual Memory page in Kernel Aduitor if it's fine.
[Magisk] Fahrilubis:
Dude can u share link for module safety net like ur pict? I need safety net fix, then is really work? My phone sagit too then safety net always break after first reboot
[Magisk] BDZC:
im quite surprised how big the difference is.

Before i installed this module i wasnt able to play anything lately.

My Nexus 5 feels like 1000% faster and smoother now. Big thx
[Magisk] madbat99:
Why don't you just use magisk hide props config ? To set the proper fingerprint. In the pic you are talking about, the module says it just sets the proper fingerprint. The module I just linked does the same, for any device.
[Magisk] EarlyMon:
Glad it helps! :)
[Magisk] sandaljrpit:
Thanks

:)
[Magisk] raxijuciro:
so if my swap is already 0, I dont need this module?
[Magisk] EarlyMon:
Welcome :)

Correct. :)
[Magisk] EarlyMon:
BTW, I ought to point out that the Swap Torpedo does NOT affect safety net.
[Magisk] lazostat:
I have oneplus5 with 8gb ram. No lags so far. Do i need this?
[Magisk] Ferbee:
Hey just wondering if this is working or not from what I can tell it is.. because ram truth swap had stuff in it before but would still just like to clarify because I'm running a Samsung device and nothing ever works o nthese first try thanks :D

(The pictures uploaded are from after swap torpedo was installed, before it was installed it showed different readings)

Also does this hinder battery performance at all?
[Magisk] godofsalt:
Welp, guess you answered your own question.

Looks as if it's working. Good job!
[Magisk] EarlyMon:
The question is do you need more virtual memory when you have 8 GB of the real thing.

Try it and decide if it works better for you or not - it's completely safe to try and uninstall if you don't want it.

As you can see, the Swap Torpedo knows how to deal with Samsung's approach.

Battery life - it depends.

Many people find greater battery life without the added load unnecessary virtual memory work.

Others however end up getting more running than before (as opposed to going to sleep while swapped out) and get less battery life.

Others get a combination of the two and see no difference in battery life.

The Swap Torpedo makes no permanent changes. You can uninstall and reinstall it to test your personal battery results and go with what works for you.

We all use different apps differently so there's not always just one answer here.