Enabling swap on ssd necessary? if so, advised size

Hello, so i installed an m.2 ssd on the jetson. Now all the system storage is on the ssd. In fact I have removed the SD card. I set out to configure swap on the ssd. first question:
Is this necessary? since when i run swapon show, I get the following output:

sudo swapon --show

NAME       TYPE        SIZE USED PRIO
/dev/zram0 partition 647,1M   0B    5
/dev/zram1 partition 647,1M   0B    5
/dev/zram2 partition 647,1M   0B    5
/dev/zram3 partition 647,1M   0B    5
/dev/zram4 partition 647,1M   0B    5
/dev/zram5 partition 647,1M   0B    5

If it indeed is necessary, how much size do you advice i should allocate for it. the ssd is a 500GB Western Digital SSD.
For reference below is the result of df -h

df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1  458G   14G  426G   4% /
none            3,5G     0  3,5G   0% /dev
tmpfs           3,8G   40K  3,8G   1% /dev/shm
tmpfs           3,8G   31M  3,8G   1% /run
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           3,8G     0  3,8G   0% /sys/fs/cgroup
tmpfs           777M     0  777M   0% /run/user/0
tmpfs           777M   24K  777M   1% /run/user/120
tmpfs           777M  148K  777M   1% /run/user/1000

Thanks

You only need swap if you run out of physical RAM in an ordinary user space program. If you lack enough memory for physical hardware, e.g., the GPU running CUDA, then swap will not help (hardware such as the GPU requires physical hardware and cannot work with virtual memory, but user space programs are not hardware and do not require physical RAM).

Unless your system runs out of memory and locks up or kills off applications, then you do not need this. Do you have a program running which requires more RAM than what is present? The old “rule of thumb” was no more swap than twice the physical RAM. For example, if this is a unit with 8 GB of RAM, then swap would be no more than 16 GB.

Then at this moment i dont need it. My project may need it later but not at this moment. I will worry about it when time comes.
Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.