When executing some programs on jetson nano, since the memory of nano is only 4GB, the following error message may appear, for example: OSError: Cannot allocate memory problem. You can try the following method to solve this problem: This problem can be solved by installing swapfile.
$ git clone https://github.com/JetsonHacksNano/installSwapfile
$ cd installSwapfile
$ ./installSwapfile.sh
If executed ./installSwapfile.sh
without adding any parameters, it will be hung in the /mnt directory by default, and the default size is 6G.
The operation to delete this swap space is as follows
$ su root
$ swapoff swapfile
$ rm /mnt/swapfile