i have the swap file within RAM that way the swap file runs at the same speed as the RAM which is faster then SSD. also this way the swap file is deleted every reboot/start up and gets reconstructed afresh. i give the swap file 10% of the available RAM, i have 64GB of RAM so the swap file is 6.4GB.
this works for me.
best of luck, Steve ..
Swap is different from paging -- swap usually copies a WHOLE users address space on to the swap area which means when used a lot more data has to be transferred from the swap device to internal RAM -- even with fast Nvme devices internal RAM is still orders of magnitude faster than SWAP.
Paging on the other hand just means chunks of memory - that aren't being used by an application can be "borrowed" by another process -- so the chunk of memory allocated to the original application can be written to the paging device while the other process can "grab" the chunk of RAM released -- far less data transfers needed (IN NORMAL SITUATIONS !!!!).
But beware -- if too many apps are running concurrently and / or not enough RAM in the system a condition known as "Thrashing" can occur. This causes almost all of the OS to keep attempting to write / re-write "chunks" of data to the paging device --on slower paging devices this will probably show up as a nearly continuous LED light on the disk access mechanism and almost zero response on the system.
For suggested system paging file sizes - I'd just leave Windows to do its own thing here -- there's all sorts of really complex algorithms such as LRU (Least Recently Used etc) plus some complex A.I database keeping details of what the user's most common tasks are so the OS can build some type of "Guessing Prefetch" -- i.e if it knows you use photoshop almost every login then at start up much of that application's start sequencies will be on the paging device where it's still a load quicker to load into RAM than from the application data on a standard OS disk.
In Linux distros Swapping / paging are essentially "interchangeable" as it's really "paging". Most sensible Linux distros can use internal RAM for this -- typically it's "ZRAM" -- in this case look at /dev/sram0 and a good default is to allocate 50% of RAM size -- so in this case 8GB.
e,.g as here on a 16 GB RAM minipc running Fedora 42 (KDE version) with a Windows 11 8GB VM
As Linux is mega efficient in "swap / paging" as my W11 VM is fairly quiescent at the moment there's zero activity on SWAP (/dev/zram0). The RAM allocation is due to 8GB for the Windows 11VM and the rest for the Linux Host.
I'm sure the same in other "proper" Linux distros -- For speed etc I prefer ArchLinux but for generic testing Fedora just works -- the "Big boys" at Redhat and IBM have mega experience in this stuff and it generally works !!! -
Cheers
jimbo