If you are stuck with a 32-bit Perl, you will find yourself limited to at most 2GB even if you have a large swap file enabled.
However, if you are using an appropriate version of windows, it is possible to extend that limit to up to 3GB (even if you don't have 3GB of physical ram installed). This requires 2 steps:
- You have to enable your system to handle it by adding the /3GB switch in boot.ini.
- You have to enable perl.exe to handle it by adding the /LARGEADDRESSAWARE flag in the executable.
This can be done using editbin.exe.
Some details on this can be found at MS. Google for "/3GB" and/or "/LARGEADDRESSWARE" for more.
The interesting thing is that if you are running a 64-bit windows, but a 32-bit Perl--which makes some sense as there are far fewer modules readily available for 64-bit Perls, then you can gain significantly by editbining your 32-bit Perl executable to be /LARGEADDRESSAWARE
Without that enabled, the most memory I've succeeded in allocating (in 1MB chunks) with Perl 5.8.9 is 1.8GB. But a simple editbin /LARGEADDRESSAWARE \perl32\bin\perl.exe, and I can now allocate 3.767GB.
Which is an interesting conundrum to explain, but in large part negates my reasons for using a 64-bit perl. Because although I have allocated more than 10GB using perl64, once it gets into swapping, the system runs like a dog, so I don't go there other than for the experiment. And 3.7GB is close enough to my 4GB physical ram that, with the easy availability of so many more modules, I might regress.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|