You do not always have available disk space for virtual memory, but in general, the answer is yes, it is getting there. The operating system will do the paging for you, e.g. in the swap partition created on Linux.
Either way, you could run out of memory, and if that is any concern, you should check against that in your application.
Please note that it is much slower to do disk I/O though than reading and writing real RAM memory.
I think this should get you going:
Virtual memory combines your computer’s RAM with temporary space on your hard disk. When RAM runs low, virtual memory moves data from RAM to a space called a paging file. Moving data to and from the paging file frees up RAM so your computer can complete its work.