How to Create Swap Space on a Linux VPS
Without swap, a memory spike can OOM-kill processes. A 1–2 GB swap file on a 1–2 GB RAM VPS is usually a sensible cushion.
Steps
Check whether swap already exists:
free -hswapon --showCreate a 2G file, format and enable it: