Swap File Size Calculation
Every VM have some amount of Memory configured. So when we power on the VM, vmkernel have to create the Swap file for VM (this file is different file than vmdk file), so that in case of memory contention overallocated memory can be delivered (in the storage there must be free space available to create that file otherwise we can't power on the VM).
Swap File is calculated using the below formula:-
Allocated Memory to VM - Reserve Memory to VM = Size of Swap file (.vswp)
Suppose VM is configure with 2048 MB of Memory and Reserve for that VM is 512 MB then swap file size is 1536 MB as per above formula:-
2048 - 512 = 1536 MB.
Even you reserve 100 % allocated memory to VM swap file still created but with 0KB in size.
Swap file created even you have enough memory on host, but vmkernel only use this file (in case of memory contention) if demand of memory is more than the available amount of Memory on Host (ESXi).