How can I make a program use virtual memory in Windows?
I have a long perl script which is using 6GB+ of memory and increasing. My machine only has 8GB or RAM. It is probably caused by a memory leak in a module, but there is nothing I can do about that now.
Is it possible to make it use virtual memory, or is this something controlled by Windows only?
The OS will provide virtual memory automatically if needed and if it's configured to have swap space. You cannot control that from a Perl program.
If your Perl program has a memory leak eventually it will start being swapped to the page file. When its memory consumption causes total memory to exceed the sum of your physical RAM plus page file, things will slow to a crawl and processes may become unresponsive and/or crash.
In any case, the size of the page file cannot be change dynamically, a reboot is required. The only long-term fix is to find and fix the leak.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With