-
I agree that swap can kill flash storage, but in current state, my phone is hardly usable.
I did experiment:
- Rebooted so that OS memory would be as clear as posible.
- ssh'ed into it and watched free -m output - it started with about (only!) 270MB avaialble memory
- Launched uNav, and kept scrolling as I if was driving.
- After some time, available memory got down to tenths of megabytes, and whole Untiy crashed!
I have these crashes when browsing with browser, or Reddit webapp, or similar. Just click on some link and boom - crash.
Swap HAS to be much bigger on such small memory devices as BQ E5...
I'll try to create bigger swap file and modify fstab to mount it...
-
Yep, no longer creashes. I see about ~180MB of swap spaces used up constantly, and uNav, Reddit webapp does not reproduce crash.
-
-
Hey,
Sorry for resurrecting a dead discussion, but its seems tobbe an issue for me too.What pazzles is does the size of the swap matter? I mean when the system run out of memory it will start swapping an writing to disk does it matter if its for a 32mb file or 1gib? I would think that the vm.swappiness kernel argument (which on the pinephone is on 60 ) will be more usefull here. Am i missing something?
BTW i'm askin this as im trying to improve pinephone performence and swapping and memory seems to be the biggest simple solution.
-
@darkeye zRAM should be used instead. Swapping to disk will incur a massive number of writes to the eMMC, thus reducing its useful life.
-
@dobey i understand the reason behind it but also a little puzzled as in this regard isnt 32mb is as bad as 1 gib? as the only thing we care about here is write operations (iops) and not the size stored on disk ( i'm sure that there will be some reduction with 32 mb as there will be less apps running in perellal but still... )
We can also reduce the swappiness tobhave a more prenunce effect with a limited swap size
In any case i've added zswap to my pinephone with 1GiB of swap abd reduced swappiness , i'll try and use it as a 'daily driver' ( as much as the pinephone can be... ) and report disk usage statistics in a few days.
-
@darkeye I don't know why specifically 32MB swap was used at all, instead of something a bit larger (beyond the fact that of course storage is limited on phones anyway).
All I can say is that the solution isn't "make a bigger swap partition/file" but instead to use zRAM and not use swap.
-
@dobey said in Swap space reduced?:
but instead to use zRAM and not use swap.
I still add extra 1GB swap file after every reboot, even with zRam available. BQ Aquaris E5 is barely usable with it's 1GB Ram otherwise. Try browsing uMastonauts and open found links in a browser - one of the app will be "blurred away".
But I guess it's an exception, and I will have to upgrade to newer and more powerful machine once E5 (Ubuntu 16.04?) will no longer be supported anyway.
-
Maybe we can add a swap creation tool to the UT- Tweaks app. this way the user can choose.
Also this way the user can also use the SD card as swap it will be slower but will solve the degradation issue (Which BTW on the current 1 days (none-) statistics i have seems to be kinda ok, will probably loose 1GiB of storage after 5 years on normal use as the average write operation is 0.68/s ). -
@darkeye Not all devices have external SD card support. And well, you immediately lose 1GB of storage by reserving it for swap, anyway.