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
76 stars 6 forks source link

Why choose swap and not zram? #22

Closed michael1900 closed 6 months ago

michael1900 commented 7 months ago

This is not an issue, i have only some questions. Why you prefer to use swap and not zram? Why we should use swap and not zram? Is better zram or swap? For battery is better zram or swap? There is not a clear answer in the net.

Thanks

janithcooray commented 6 months ago

Its a bit conditional and controversial... Zram is compressed Memory allocation data on Physical Ram Swap is Memory allocation data on a storage device (Phone's Internal Storage in this case)

Swap generally activates when the application is not in use or has a low priority. But this heavly depends on how your ROM or kernel handles swap and Zram.

Logically, Swap would give better battery life compared to Zram as it does not need to actively compress/decompress data (depends on usage). But at the cost of performance (applications will take longer to resume).

Why you prefer to use swap

Swap is handy for devices with lower memory or old devices. it helps keep more apps in the background. Zram would require some free memory.

Why we should use swap and not zram

This is upto you. if your devices does not have enough memory to keep 4 or 5 apps in backgroud, id suggest Swap over Zram. If not Zram would would be better.

Hope this helps