How to Increase Virtual Memory Size in Linux and Windows
For Linux:
Check if a swapfile is already active:
sudo swapon --show
Turn off and delete existing swapfile:
sudo swapoff /swapfile
sudo rm /swapfile
Then proceed with recreating it:
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Make it permanent (optional):
sudo nano /etc/fstab
/swapfile none swap sw 0 0
Optional Tweak: Reduce Swappiness (Better for SSDs & RAM):
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
For Windows 11:
- Press Windows + R, type sysdm.cpl, and press Enter.
- Press Advanced, and then Performance (Virtual Effects) -> Settings.
- Press Advanced, and then Change.
- Choose the drive [Volume].
- Choose Custom Size.
- Set Initial Size (MB): 4096
- Set Maximum Size (MB): 8192
- Press Set, and then OK.
Comments
Post a Comment