Memory mapped files use virtual memory. You'll have no trouble mapping many more gigabytes of VM space than you have RAM on a 64-bit operating system. The point of a demand-page virtual memory operating system, the sum of the memory required for all running processes always greatly exceeds the amount of RAM.
Mapping it to RAM costs money, that's where the demand comes in to play. The processor interrupts the program and yells for help when it tries to access a virtual memory address that is not mapped to RAM. Called a page fault.
If you did not spend that money on getting at least 40 GB of RAM then you'll inevitably pay the cost of the OS dealing with these page faults. Which requires allocating a RAM page and filling it with the content from the file. Perf go South when it has to unmap previously mapped RAM and save its content to the file. Followed by re-using the freed-up RAM page and loading file content from the appropriate file offset. Very deer, the disk is slow. A problem known as "thrashing".
It is much less of an issue when you address the memory sequentially, one page fault is good for 4096 bytes of sequential access and you'll have good odds that the disk reader head is still in the right spot when you trip a page fault.