yashsingh1/xdaforums huggingface dataset:
[Magisk] Schroeder09:
I also noticed the CPU differences. Those differences have been more noticeable than the battery gains at this point, but they go hand in hand of course. Before when I would go into EX kernel manager I would see the little and big cluster frequencies bounce around. Now the little cluster bounces less and the big cluster just sits there doing NOTHING at 345 MHz. I pop in and out of the app just to get the CPUs to spike to make sure the monitor's working. The monitor is working of course.

I did not take a screenshot of the CPU stats to see if the percentage of time spent on the lower frequencies rose after installation of the module, but I wish I would have because you can definitely see that the CPU is working a little less if you're like me and take a look at these things fairly frequently.
[Magisk] MrPhilo:
How's the ram management on the pixel?
[Magisk] killerBRs:
I'm using latest version from Magisk Modules downloader but..

Is not working, My Galaxy s6 edge swap is "0"

Simply only deleted Swap,

But no other effect.

G925i, Android 7.0, Latest Firmware

Latest Magisk 16.0
[Magisk] EarlyMon:
That's what it does - removes swap.

If you're not noticing any other differences then you proved the first claim - that your phone was running constant processes that you don't need.

How much battery life you can get back from removing those processes, how much less heat you're putting on cores and the battery, and how much headroom you get for your phone to respond where it would have lagged before is up to what you use and how. :)
[Magisk] madbat99:
What were you expecting? That is literally the description of what it does.
[Magisk] takur69:
magisk 16.0 stable

swap 0.mb:confused:
[Magisk] EarlyMon:
Correct. :)
[Magisk] piptron:
I installed from the repo. Using magisk v16 stable. But after reboot no change in swap file whatsoever. Please help.
[Magisk] takur69:
Thnk you :victory:
[Magisk] piptron:
I edited the TL in the service script and changed it to 80 got mine working. Thanks
[Magisk] EarlyMon:
:eek: Surprised that set up took that long - good work extending the time limit!

I'll add to my notes for the next change, thanks! :)
[Magisk] piptron:
Well I was thinking of changing it to 50 till 70 but Im lazy and assumed 80 would do, and it did. :laugh:

---------- Post added at 09:55 AM ---------- Previous post was at 09:27 AM ----------

Testing the TL seems like any value from 50 below doesnt work for me. But 51 is just right. No need for 80
[Magisk] EarlyMon:
Excellent. :)

I'm going with 60 for the extra margin.

I've tested it and updated the repo without a version change - no point in sending everyone already working through an update cycle. ;)
[Magisk] modaifallah:
Man wtf!!!

The phone is 2X-3X faster that I increased animation factor in developer settings ?

Battery is way better (maybe unrelated but it's observed).

Good idea man, I had 4 gb ram on my S7 edge and I always said swap isn't needed and by luck I found your module on Google.

Well done, man! I'm gonna donate ASAP.
[Magisk] EarlyMon:
Thank you, glad it's making the difference for you! :)
[Magisk] Schroeder09:
How can I best answer this for you? I hope these pics help. To answer based simply on "real world experience" and not based on quantifiable numbers; I think the RAM management on this phone has always stunk. Idk what I'm doing wrong or what I have to change to make it keep apps loaded in the app drawer.

When I saw this post I began opening a bunch of apps, but this in itself isn't necessarily real world for me because I rarely have over 4 apps open. On a normal day I might have the messages app, Tapatalk, XDA, Gmail, and chrome open. That'd be a lot. I typically close apps. I have only recently began to leave some open because I read that it's not needed to close them all the time any more, and that closing the apps all the time actually eats battery. I'm not sure I believe this, but nevertheless.

So, if your RAM management question is based on how well this phone keeps apps loaded in the background, a general answer is that it doesn't. It didn't before installing this module, and it doesn't now. I was hoping this module would help with that.

If you guys have any suggestions I'd love to hear them. Perhaps my understanding of how this phone should work is simply unrealistic. You can see in my screenshots that I don't have much available RAM, and that's always been the case. If you look early in the EX kernel thread I posted about having the same problem way back in December or so.
[Magisk] EarlyMon:
[MENTION=8702930]Schroeder09[/MENTION] I want to ask some questions without giving offense or having them taken the wrong way ok.

1. Are you expecting ram use to indicate CPU use or battery consumption? (No, I am not calling you a rookie.)

2. Are you having performance issues? (And "not sure" because you have a lot in memory is fair enough.)

3. Did you get a chance to look over how many and which apps launched on boot? (I mentioned that earlier, not sure if you saw it.)

Your question is simple at face value but operating systems are complex and Android is no different. Your answers will hopefully allow zeroing in on the simplest answer.

BTW - most Android apps launch automatically using a system of "intents." You want the phone? It's going to trigger the launch of contacts, messages, and anything else you have tied to those, for example. Start on boot - toss that in too for now.

The reason that task killing eats more of your battery is that that system is going to end up relaunching everything - and the relaunches are going to be read by the system as something you need, rather than apps that you're not touching that can be parked out of the way.

I promise I know that's true - I'm the guy that showed how anyone could set up and monitor their power use to prove it for themselves - it was part of the process that resulted in RAM Truth.

I know that it's hard to believe but it's true - widespread and constant task killing uses power instead of saving it.

That does not mean that you are stuck and out of management options.

Let me know. :)
[Magisk] prasetya27:
Is this module work correctly ? Idk about that ?
[Magisk] EarlyMon:
Yep.

Your swap is off - zero size. The module works exactly as claimed or you did not have swap to begin with, in which case the module had nothing to do.
[Magisk] prasetya27:
Before i use this module.. I check on RAM Truth app, and I already check that my phone have swap memory enabled with 512mb, and become 0mb after I install this module..

Sorry for bad English :D
[Magisk] EarlyMon:
Let me know how you like it. :)

I don't worry about language. You should hear me away from home! ;) :)
[Magisk] Schroeder09:
No offense taken. I'm not great at his stuff. Rooting this phone and doing all this stuff to it has been a huge learning experience for me that I've enjoyed. I'm a noob though. Plain and simple.

1.) I guess I thought RAM use indicated how quickly apps loaded and especially how and IF they had to reload when pulling them back up after they've been in the app drawer all day. If they don't have to reload you have good RAM usage. If they do have to reload when you pull the app back up the phone has bad RAM usage. That's what I thought anyway.

If CPU speeds are an indication of RAM usage then this module has imporved RAM usage. As stated in a post a couple days ago, when I look at the CPU speeds in EX Kernel manager they both sit very low. There aren't constant spikes for no reason. The spikes I do see don't jump all the way up and hit max speed. They will only jump a little.

2.) I wouldn't say I'm having performance issues. It just seems like webpages and apps often have to reload when I call them back up from the app drawer. As mentioned in yet another post, I do switch wifi networks a lot because there are 4 in my house, and I read somewhere that this by default will cause all web-based apps to reload. Is that true? I can tell you that I have been paying more attention since using this module, and some apps are doing it when they shouldn't be IMO. The XDA forum app reloads literally 100% of the time if I leave it except for when I'm writing a post. I think this particular issue is specific

to the app though. I haven't been impressed with the XDA forum app, but that's another topic.

Furthermore, the phone IS snappy. It does seem to load stuff quickly. The having to reload stuff all the time is the only annoyance I experience, and I'd I hadn't gotten involved on this forum I would have never noticed it. The phone is great, and I don't think I'll ever leave google again. I'm coming from the Samsung world. I have a work iPhone, so I know what that's all about. I'll NEVER go that way, but that's probably safe to say of most people here haha. I do seem to have unregistered touches quite often too, but that's nothing that we're considering here I know. I hope that's fixed in next months update. I think I saw something about the multi-touch issue being addressed then anyway.

3.) No I haven't. I did miss that post. I'll try to search for your earlier post outlining that process and give it a whirl.

4.) That's a good explanation for task killing eating battery. You have me convinced. The articles I've read on the topic haven't given good descriptions and explanations like that. Thank you.

By the way, ARE my RAM stats strange? Is the available amount indeed below where it should be on this phone?
[Magisk] EarlyMon:
[MENTION=8702930]Schroeder09[/MENTION] Thanks for the detailed response!

1. What you think about ram management with respect to reloading is absolutely correct, to a point.

CPU speeds are not a measure of ram usage, just a measure of task demands. Sometimes the two go hand in hand but CPU use is all about running tasks.

2. The network stack is the bane of our existence. If the app is written to be connectionless, where all access is temporarily as needed, you won't notice much reloading. If it uses persistent connections then you can expect lots of reloading when you change networks. On a phone with good VoLTE management and wifi calling you can walk in and out of networks while having a conversation and never notice the handoff. Unfortunately not everything behaves that way. Also with web apps, it can make a difference whether they cache to ram or to storage. (Edit - maybe I'm thinking of stateless? I worked all night so I might have terms scrambled that I would normally not.)

Try your multitasking button instead of the app drawer. That helps with a few of mine but certainly not all.

3. Looking forward to hearing back.

4. Thanks. :)

As far as what's normal - there's normal for you. It's not a squishy answer - because I have extra ram I'm now running close to 1 GB of process monitors to support my other development exploration. In your case, you'd want to run them one at a time. Never underestimate how monitor apps can degrade available memory. When I'm done I'm going to turn all of mine off.

You can freeze apps that you don't need often. I use Titanium Backup Pro for that and I have widgets on a spare screen that can deactivate an app or turn it on and launch it with a single tap. Pretty handy and effective management trick.

The Android mantra for years has been "empty ram is wasted ram." When not carried to an absurd extreme, it's basically true (you need some empty just to get around, so never chase the extreme).

After managing unnecessary start on boot apps (freeze them) you may get some extra ram back to help with caching and page reloading - but as I said - that also depends on other factors too. Worth exploring though.

Remember - always make a nandroid backup with TWRP before freezing apps. You want a safety net to fall back on if you freeze the wrong thing and get into a boot problem (not easy to cause that but it can happen).
[Magisk] Soydere:
Thank you man, s7 edge with oreo ERD2 rom
[Magisk] piptron:
[MENTION=225651]op[/MENTION] do you have any knowledge about services.jar, ADJ values, minfrees? I was thinking maybe someone can revive the v6 supercharger script for marshmallow and up. So we can benefit from huge RAM specially on multitasking.
[Magisk] EarlyMon:
Welcome :)
[Magisk] EarlyMon:
I remember the Supercharger, that was a long time ago for me. :)

You may find some good advice from [MENTION=5488402]Davey126[/MENTION] or me by searching the thread for LMK or OOM or minfree. I think Davey gets into more detail on it.
[Magisk] Ogy77:
Flash in twrp recovery?
[Magisk] EarlyMon:
I've only installed it from the Magisk Manager.

That said, it is a very simple module and I've made NO changes to the installer scripts included in the Magisk 1500 template.

Make a nandroid backup first (including system and data) from TWRP before trying it, same as you would with any TWRP-installable mod, if you want to go that route.
[Magisk] Ogy77:
I flash in magisk manager. Thank you sir
[Magisk] k4piii:
Great Job man, thank you. I am not a billionaire, almost broke but with your tweaks I will be better and thank you so much for this :D trutly appreciated
[Magisk] Schroeder09:
-What multitasking button? Do you mean the little square on the nav bar that you double tap to swap apps?

-What sort of monitoring apps are you talking about? Like better battery stats, RAM truth, and ex kernel manager?

-Empty RAM is wasted RAM? So I want it full? Why?

-whats all this talk about "nandroid backups"? Been on here since October or so, and I still have no clue what that is. Is that just a twrp backup? Is it just a silly term for "backup"?
[Magisk] EarlyMon:
Glad you like it - big screens for the win! :)

PS - Cheers for the second post reference. :D
[Magisk] EarlyMon:
Yep. Tap it once to show recent apps.

Yep. I use System Panel 2, Network Connections, GSam Battery Monitor and others. System Panel takes up over 500 MB.

Android is all about choice. You don't have to want it (kind of) full but many of us do.

Why? Because why not. It costs the exact same to power empty ram as it does to power ram with apps sitting idle that I can switch to more quickly sometimes with the multitasking button as opposed to always launching them from the app drawer.

Unlike some other devices, free RAM is not an indication of CPU or battery loading.

It comes from the early days of phones using nand flash storage chips and before we had TWRP.

It sounds silly, when you listen though, maybe the word "shoes" does too.

Just as not all footwear are shoes (slippers, flip-flops), not all backups are nandroids.

Aside from the reserved partitions that we have no business going near (other than to make a special backup), what is the set of partitions that we want to backup to give us a snapshot of our phones - a backup set that if restored would seem like we jumped back in time to when we made the backup (sort of bit-perfect)? That's a nandroid backup - it has in the past always meant that snapshot for the boot, system, and (app) data partitions.

Today with Oreo devices using Project Treble that set may vary from phone to phone. I now have kernel and ramdisk partitions and you don't, you have A and B operational boot and systems that I don't. Check with others using your phone to make sure that you backup the right partitions for your phone if you have Treble to make the proper nandroid backup.
[Magisk] Schroeder09:
Just set the background process limit to 4 in developer options. It was on standard limit. What is the "standard limit"? How many processes is "standard"?

Do if I get this quick system info pro it will tell me which apps run on boot. Then I can go to titanium backup and freeze those apps IF I don't need them? This will free up RAM? Will it make the phone faster and not have to reload apps all the time? If it won't do anything other than free up RAM I guess there is no need to do it since as you said, "free RAM is wasted RAM."

Isn't this another "monitoring app"? Won't it actually use up MORE resources since you've pointed out that monitoring apps use a lot of RAM?
[Magisk] EarlyMon:
[MENTION=8702930]Schroeder09[/MENTION] - either freeze or uninstall Quick System Info PRO when done. I just install it when needed and then take it off again.

Whether freezing apps you don't need much will speed anything up depends on whether the app is using the CPU in the background or not. Whether you notice a ram difference is up to what you have installed and what it's trying to use. I have apps that use both that I only want on occasion so I freeze them.

These are things to explore. I do not predict that freeing up more ram at this point will have any battery benefit - you already reported that getting rid of swap has put your CPUs pretty much at rest.

If you're trying to stop apps reloading, remember what I also said - some apps, you can't help that.

I do recommend making one type of change at a time and seeing how it goes. Get rid of the monitors and see if it helps your apps reloading.
[Magisk] killerBRs:
I noticed only LAG in this time, for a 3GB RAM that only 800~300 are free to use, only caused slowdown...
[Magisk] DB126:
No script needed. Try LMK values suggested in previous post. You might be surprised. No need to worry about minfree or OOM tweaks if LMK values are properly set.
[Magisk] EarlyMon:
LMK values = minfree values, same thing. ;)

FWIW, I agree, nothing else in the OOM set needs to be messed with.
[Magisk] EarlyMon:
That's unfortunate. Best to uninstall the module and thanks for trying the Swap Torpedo. :)
[Magisk] DB126:
The term 'minfree values' and other clever variants are often, albeit incorrectly, used to reference LMK thresholds. I was referring to min_free_kbytes.
[Magisk] EarlyMon:
I don't know what else I can tell you about calling them minfree values. :)

The numbers shown from my terminal are 4k pages, so (80640*4)/1024=315 MB, which is what Kernel Aduitor and everything else thinks that threshold is in my example.

Some Samsungs in the past have used system properties instead for the thresholds, I don't know if they still do or not. Everything I've seen in standard Android uses the values in the minfree file, set by an init script.

/proc/sys/vm/min_free_kbytes is a single value so that's not right either.

I'm also ok with either LMK values or OOM values. They are as inaccurate as anything else we've said and all of them will help people find the right discussions and the tools to help them. :svetius:
[Magisk] DB126:
Yeah, I know. Terminology has been munged for so long we now argue for coexistence based on common usage. Nothing said here will change that.

From my perspective LMK values >< minfree values and posted accordingly.
[Magisk] EarlyMon:
Yeah. They've been the values in the minfree file since they existed here afair. The first apps to adjust them were called minfree managers.

It's just the Android convention of using slang, and not sure that slang is limited to Android. LMK is slang for out of memory manager. No different than calling an operational image backup a nandroid backup. A rose by any other name. ;)
[Magisk] Shubham87:
Been using this module for almost 3 days now!

Man I'm impressed and how! It's as if my phone is reborn! Truly great work!

Thank you so much for this! Cheers! :victory:
[Magisk] Hai Karate:
This module doesn't seem to work under Magisk 16.4, at least on my Galaxy S7 (G930W8) running the latest stock Nougat ROM. Reverting back to 16.3 got it functional again.
[Magisk] EarlyMon:
Glad you like it! :)

I was reading about 16.4 earlier tonight and I wondered about that given the changes.

If you have time to test it and don't mind, please let me know how it works with 16.4 and Busybox-NDK installed (or let me know if you had busybox-ndk installed already).

If it's still broken, if you can get me a copy of /data/adb/magisk_debug.log that would be outstanding.

Many thanks for the report and for your help supporting the Swap Torpedo community!

PS - I'm on 16.4 now and no trouble with or without Busybox, so it seems that it's some combination of factors.
[Magisk] Hai Karate:
Still no luck on 16.4 with Busybox NDK. I've sent you a PM so you can download the log.
[Magisk] EarlyMon:
After magiskal incantations and the offer of a coconut, a great voice came from the cloud and said, "Please have him try this and report back in the Swap Torpedo thread..."

https://xdaforums.com/showpost.php?p=76390955&postcount=5636
[Magisk] Hai Karate:
OK, I tried jenslody's build of Magisk and no luck. Please let me know if you need any info/logs/extra coconuts.
[Magisk] EarlyMon:
Every action helps, many thanks for the trial.

Best stay off the 16.4 beta, meanwhile I'll prepare an extraction of your log and post back with some limes to go with the coconut. :highfive:
[Magisk] EarlyMon:
Coconut - check, lime - check, logs - check.

I called The Doctor, I woke him up! I said Doctor...

Issue reported on post 283 above.

Attached is the log where 16.4 didn't seem to find the Swap Torpedo module - or had something else going on, I couldn't say. :(

Also my 16.0 log showing the expected behavior.

https://drive.google.com/file/d/1crWQvfdxDl93SBdllTDxUYTqccbHoS0M/view?usp=drivesdk

No idea why xda isn't letting me upload files just now. :p

Thanks! :)
[Magisk] Didgeridoohan:
I took a quick peak at the log [MENTION=2682748]EarlyMon[/MENTION] posted above and there doesn't seem to be any late_start service running at all. That would be problematic for this module... :laugh:

Does any of your other modules have any scripts in service.d or a service.sh script running? If so, do those work?

You can confirm if late_start is working by placing a script in /sbin/.core/img/.core/service.d and see if it runs. Make a file, name it whatever (test.sh, or whatever tickles your fancy), put this inside, and give it permission 755:

#!/system/bin/sh
echo "It works!" > /cache/test.txt

If the file is in /cache at the next boot, we'll have to think of something else...

...Drink 'em both down...
[Magisk] Hai Karate:
Your suspicions appear to be correct -- the script executes under 16.3 but not under 16.4.
[Magisk] Didgeridoohan:
So, the next question: why does late_start services break for you on v16.4? I haven't seen anyone reporting about this anywhere else yet... Could it be the changed sepolicies?
[Magisk] EarlyMon:
The beta thread warns that there's more debug statements than usual on the beta release - but his is flooding. Race or missed sentinel under those conditions? Did the log show the end of the expected boot/init sequence?
[Magisk] flipmode_11:
Wow, really impressed with this, and very good question. :D I am looking at a couple device options - Deca Core or Octo Core with either 6GB \ 8GB of memory. So an excellent point re: swap.

But what about the other end? All the small TV Boxes that have only 800MB of memory? :confused:

What can be done to improve the performance and reliability? e.g. Increase zRAM, VMSwap, Compression, etcetera...?

Also, what optimisations can be done in resizing partitions? Trimming 500mb here and there to increase swap or other memory functions...

Another topic I've been pondering is the benefit of LP DDR4 memory over LP DDR3? e.g. 4GB of DDR3 vs 3GB of DDR4. Do you go for more slower RAM or less faster RAM?

Keen to hear your thoughts Dev! What other modules can be created to optimise performance? :good: