I have read a few replies on stackexchange that using swap is actually bad on a pi since the HDD is on SD card. By default Raspbian comes with 100MB swap enabled. Should I disable swap altogether? Are there pros or cons to doing so?
Asked
Active
Viewed 2,417 times
1 Answers
1
Swap is only used if you run out of memory.
The Pi normally uses a swapfile, which if not used has no penalty, but if required is slow.
Without swap the OS will terminate low priority processes or crash. The choice is yours.

Milliways
- 59,890
- 31
- 101
- 209
swappiness
among others). Because this behavior is dynamic there is some argument to disable swap to preserve the SD Card, on the other hand, it is less reasonable to increase the threshold to 100% because this will cause more thrashing than the default value as the OS tends to swap out cached files and unused code sections first, and you preclude pre-emptive swapping with a large swapiness value – crasic May 21 '18 at 03:02