janithcooray / lin_os_swap_mod

increases the SWAP memory by an additional 4GB or 8GB for Android 7.0 or above
GNU General Public License v3.0
60 stars 6 forks source link

Not using swap #1

Closed abcdUwU closed 10 months ago

abcdUwU commented 1 year ago

Samsung A51 device with rom lineage os uses a very small amount of swap, in the amount of several megabytes, while there is 10 gigs (2 gigs system + 8 gigs swap magisk) of memory!

janithcooray commented 1 year ago

@abcdUwU Sorry about the late reply, but the swap takes a few hours to kick in. keep it for about 3 hours after opening a few apps and see if the issue persists. also mention which version of lineage is installed

Thank you for using this!

abcdUwU commented 1 year ago

Thanks for the answer, but I don't use lineage os anymore, but I think it was version 20, made by royna, which was specially made for the a51 phone. I tested up to 5 hours, but it did not use swap

janithcooray commented 1 year ago

i use the same rom i think, made by royna too. I have got another issue similar to this, ill be checking on this furthermore

citizenserious commented 1 year ago

I have the same issue on iodé OS (4.3 Android 13) (based on Lineage OS) I got 8GB more Swap but the space is never used, the system seems to find a way beforehand to keep the swap usage within the original maximum framework.

janithcooray commented 1 year ago

@citizenserious I have released the v1.2 update. i have added a feature called Set Swap Priority above Zram? choose yes during installation on magisk. ill be prioritising this issue.

Please be kind enough to check out whether the update has resolved this issue for you.

Downloads - 1.2

Thank you!

citizenserious commented 1 year ago

@janithcooray wow thanks for looking into this that fast. I am actively testing and will report back soon.

citizenserious commented 1 year ago

Screenshot_20230824-044957_App Manager It took me a while to get my system there but it seems to work. Thanks a lot <3

janithcooray commented 1 year ago

oh cool. would you be able to give me a list of apps (or sort of apps) that you use and how frequently so I can try to improve this module? I notice some apps try to stay in memory forcefully. for example - the Google search app.

ZRAM priority is currently set to about 80%, wonder if it will be better to set it higher.

I'll be keeping this issue open for a while.

@citizenserious Thanks for the update anyway!

citizenserious commented 1 year ago

I had to open many apps at once to get the 8GB to be used.

Apps I frequently use are:

Neo Launcher Neo Feed Neo Store Neo Backup NewPipe Sponsorblock MagicEarth Signal Eternity Infinity Fedilab Iceraven Spotify AntennaPod

I think that's not what a regular users would use frequently😄 But those willing to use your module probably aren't regular user anyway. Hope you could work with this information also.

Something popped into my mind while writing the list: Is it a security risk to publish which apps are used publicly? Could it be a potential target when someone knows your IP? Some could search for exploids couldn't they? Just being curious, maybe you know.

janithcooray commented 1 year ago

I had to open many apps at once to get the 8GB to be used.

Apps I frequently use are:

Neo Launcher Neo Feed Neo Store Neo Backup NewPipe Sponsorblock MagicEarth Signal Eternity Infinity Fedilab Iceraven Spotify AntennaPod

I think that's not what a regular users would use frequently😄 But those willing to use your module probably aren't regular user anyway. Hope you could work with this information also.

Something popped into my mind while writing the list: Is it a security risk to publish which apps are used publicly? Could it be a potential target when someone knows your IP? Some could search for exploids couldn't they? Just being curious, maybe you know.

Thanks a lot. ill try to see how this apps behave and add some patches to force them to go into swap


As a DevOps engineer , and a bit of a white hat hacker myself ,here is my experience on what you have asked.

Q - Is it a security risk to publish which apps are used publicly?

Answer 1 - in case you are talking related to a magisk module -

when a module is installed, we can use the module itself to find out what have you installed. if the developer misuses this, they can do some shady things. magisk/SU is pretty powerful and can inject some sort of spyware. these days android has the apps data/ directory encrypted, so its a little bit hard now. but having SU this is not that difficult to overcome. if your apps use unencrypted data on SQLite like whatsapp, they can easily add a method to upload the data from your device and read your Whatsapp texts.

Answer 2 - if not,

randomly knowing it doesn’t really cause a risk unless the specific app you use has a know vulnerability


Q - Could it be a potential target when someone knows your IP

Answer -

knowing your IP alone isn’t a big threat. this becomes an issue if you have any sensitive ports open. for example ssh-22 without authentication. or again your app as a know vulnerability. most websites you visit record you IP.

Q - Some could search for exploids couldn't they?

people can look up for exploitation methods without even knowing what you use. this is problematic if you have installed a malicious module / su enabled app in your device. we can’t really exploit with the name of the apps alone. unless the app you use has terrible security

Proof this module is not malicious

you can check inside the module file. its a pretty small read 🙂

If you want to learn more, you can look at things like metasploit to learn more about this. metasploit is a hacking tool that has few methods for android as well - even without root.

janithcooray commented 10 months ago

Patched on new V1.3

astroanax commented 1 week ago

Screenshot_20230824-044957_App Manager It took me a while to get my system there but it seems to work. Thanks a lot <3

@citizenserious How do you get this screen of memory and swap usage? I know its visible from the command line via free/htop but I don't know how to view swap usage from the android GUI

citizenserious commented 1 week ago

@astroanax it is not an android GUI, I used AppManager click the burger menu and select "Running Apps"

astroanax commented 1 week ago

btw @janithcooray I seem to be having the exact same issue, latest version. I am on crdroid, android 14. When installing. I chose 8GB, swap higher than zram, and it displayed set swappiness to 99 but after reboot it was 20. (I have 4GB of RAM)

When I check ram usage after a while, it was around half a gig, but I manually changed swapinness to 99, and its a bit better now, swap usage is at 1G. Still not quite at ts peak.