This is my first post as a user of TrueNAS so if it is incomplete please do not roast me
I am using TrueNAS SCALE 24.10.0.2 as mentioned above and I could understand that the swap space/partition is not created during the initial setup anymore (due to some bug or issue that it created it seems).
I could find some tutorials that apply to Linux in general but nothing that applies to TrueNAS Scale specifically.
Probably, but you could try. I’d suggest a swap file rather than partition, as any changes are easily reversible. To create one, change to whatever directory you want it to live in (hopefully on a SSD pool) and run (as root) truncate -s 16G swapfile (substituting 16G with whatever size you want to make it), followed by mkswap swapfile and then swapon swapfile. You can confirm your system has it available by running free.
The system will stop using the swapfile when you reboot, so if you want to reenable it, you’d run swapon /path/to/swapfile. If you find it isn’t helping, you can disable it with swapoff /path/to/swapfile, and then remove the file with rm /path/to/swapfile.
The chances are that if your system is so low in memory that you think it needs swap, then there will be no memory for ZFS ARC and you will have poor performance at best and an unstable system at worst.
TrueNAS (and ZFS-based systems) need some spare memory for use as a cache, and ZFS gives up that memory when programs needed. So if you get to the point that there is no ARC for ZFS to give up and to free more memory you need to swap, then you probably have simply too little memory to run TrueNAS.
So although you have asked us about swap, actually you might be better off giving us your configuration (MB, CPU, memory, storage controllers, disks) and allow us to advise you on the good and bad points, what you can do with what you have and what your best upgrade options might be.