I noticed that all PDF-Tools 4 DLLs have a default Visual C preferred load address of 0x10000000. Since many other DLLs also use this base address, loading a application which uses PDF-Tools dlls causes these dlls to be relocated to another address. Included is a Process Explorer screenshot which highlights the relocated dlls of a example application.
DLL relocation has two drawbacks:
1. Due to the relocation process, the application startup is slower than it could be.
2. In multi-user environments such as Terminal Services, the relocated dll cannot be shared by other sessions. This increases the memory requirements of an application, since every instance of a application has to have separate copies of the PDF-Tools dlls.
The second point in particular is a real issue to us in Terminal Server / Citrix environments, where our application has several dozens of simultaneous users in any given application server, and any memory optimization would be more than welcome.
It is quite easy to specify the base address in the C compiler and because this increases the performance of the PDF-Tools in general without any risks, it would be a really good addition to a further release.
Available and good memory ranges in general would be 0x12000000 to 0x1FFFFFFF or 0x30000000 to 0x5FFFFFFF, since these ranges aren't used by many other applications.
Another good way to do this is to use the editbin tool included in the MS Platform SDK. For example, rebasing dscrt40.dll and xccdx40.dll to a staring address of 0x40000000 would be done
Code: Select all
EDITBIN /REBASE:0x40000000 dscrt40.dll xccdx40.dll
For more information on the DLL rebase process, please see
http://www.ddj.com/windows/184416272;js ... stid=20593