Welcome to Jetson Orin NANO Developer Kit repository
08.Exchange space expansion
Swap Space Expansion
Swap Space Expansion1. Swap Space2. Swap Space Expansion2.1. Create an 8 GB File2.2. Set the File Permissions2.3. Set the Swap Space Format2.4. Enable the Swap Space2.5. Enable the Swap Space Automatically at Boot3. Verify the Expansion
1. Swap Space
Swap space is a mechanism used by the operating system to extend the available memory. It allows operation to continue when the memory is insufficient, avoiding program crashes or system freezes!
Note: the access speed of swap space is far lower than that of physical memory
2. Swap Space Expansion
sudo fallocate -l 8G /var/8GB.swapsudo chmod 600 /var/8GB.swapsudo mkswap /var/8GB.swapsudo swapon /var/8GB.swapecho "/var/8GB.swap none swap sw 0 0" | sudo tee -a /etc/fstab

2.1. Create an 8 GB File
Use fallocate to create a file of 8 GB at the path /var/8GB.swap.
xxxxxxxxxxsudo fallocate -l 8G /var/8GB.swap
2.2. Set the File Permissions
xxxxxxxxxxsudo chmod 600 /var/8GB.swap
2.3. Set the Swap Space Format
xxxxxxxxxxsudo mkswap /var/8GB.swap
2.4. Enable the Swap Space
xxxxxxxxxxsudo swapon /var/8GB.swap
2.5. Enable the Swap Space Automatically at Boot
xxxxxxxxxxecho "/var/8GB.swap none swap sw 0 0" | sudo tee -a /etc/fstab
3. Verify the Expansion
After the system is restarted, the system swap space increases to 8 GB:
