Maximizing allowable memory space for applications using PDFNet on Windows

While the prevalence of 64bit OS is increasing every day, and especially in the server market 64 bit is possibly the norm now, many of our customers are still forced to run 32bit processes.

By default 32bit processes on a windows 64bit OS are limited to 2GB, but with the small changes below, you can double the allowable address space to the maximum 4GB.

For PDFNet users running PDFNet in their 32bit C++ application, you need to build your program with the /LARGEADDRESSAWARE linker option.

For PDFNet users running PDFNet in their 32bit .Net application, you need to run the following command after creating your binary (there is no way to do this in Visual Studio, except perhaps as a post build event).

editbin /LARGEADDRESSAWARE <your exe>

As for those running on a 32bit Windows OS, you can boost your available memory space from 2GB to 3GB. Repeat the step above for which ever environment you are in. However, you have one more additional step, which is to make sure the OS itself will allow processes to go beyond 32bit (this is not needed on 64bit OS).

For Windows later then XP see the increaseuserva at http://msdn.microsoft.com/en-us/library/windows/hardware/ff542202(v=vs.85).aspx
For XP and related OS google for the /3gb switch.


The changes above will help you to get the most out of the hardware you purchased, and better protect your self from out of memory/memory fragmentation issues in general, and with extremely large, or badly formed, PDF files in particular.

Additional Reading
http://blogs.msdn.com/b/oldnewthing/archive/2005/06/01/423817.aspx
http://stackoverflow.com/questions/1346480/how-to-make-a-net-application-large-address-aware