Agreed. I use VSCode on a Pi3 with swap switched off and have no memory problems.
If this is the case, shouldn't the swap size be set to 0?W. H. Heydt wrote: ↑Tue Jan 01, 2019 9:47 pmUsing an SD card for swap space is--generally speaking--a bad idea. It has a limited number of writes per cell before any given cell fails. If you spend a lot of time writing to it, pretty soon you have a dead SD card. Better to find ways to run that don't require swap space at all.
I agree the swap file should be a last resort in this case, but it is better than the system just running out of memory and crashing. Maybe there should be a dialog like "your system has started to use the SD card for memory which is bad blah blah blah, try to close some applications"...?klricks wrote: ↑Tue Jan 01, 2019 10:10 pmFor the general user the use of swap should be avoided at all costs. It will make the RPi very slow and appear to be unresponsive.
Instead try adjusting the memory split. If not using video or camera then setting to value of 16 will give maximum memory to the CPU.
Gods. That makes me feel old. I remember when 4MB RAM was considered a lot for a PC (and earlier but then I'll be feeling ancient)
To me it also seems to be odd choice. It is too small so it is more dangerous than useful. Once both memory and swap is full it goes to swapping hell. I even managed once to completely destroy one card because after like 10minutes of constant writing I pulled the plug and card became permanently read only. And it was just one more tab in Chromium.
Yeah running out of memory is clearly a worse option than using swap; again I think there should just be a warning when using swap memory, but pushing the max swap size to 2x RAM as the default (which would mean removing the value).fanoush wrote: If the swap is larger and not full you have more chance to notice and even with 500mb swap used the system still behaves better than with 100mb swap completely full. Or at least that was my experience.
Wow that looks cool, I'll give it a try.chwe wrote: ↑Thu Jan 03, 2019 8:50 pmdid you guys ever played with zram? https://wiki.ubuntuusers.de/zRam/
actually RPis 4.14 kernel should allow it (https://github.com/raspberrypi/linux/bl ... onfig#L402). Never used it in desktop scenarios but for headless, it does a decent job especially when compiling hunge packages on an SBC.
disable swap and map 50% of ram as Zram... Some reports from the desktop guys would be interesting.
Won't that mean that your running apps have only 50% of RAM available to them so will be swapping more often with not only the normal swap overhead but the compression/decompression overhead of zram too?
Yep. And I still don't get the whole swap file in RAM thing. Sure it'll help reduce SD card wear but I really can't see any other benefit. Surely it's better to let stuff run in all the available RAM as there's less overhead and less swapping?