Multiple dll libraries baseaddress

1 view
Skip to first unread message

bw@ht

unread,
Sep 3, 2008, 11:47:17 AM9/3/08
to jBASE
We are moving to jBASE 4.1.6.2 on Windows Server 2003, SP2 using a
Sequoia emulation. We require more than 1 object library because we
have users that invoke objects and then stay within the calling
program for literally days at a time. The end result is that if we
use only one object library, it does not take a great deal of
volatility in the object code placed in that library to use up the 10
generations available to each shared object. This, in turn, makes it
impossible to catalog any new or revised routines into that shared
object until every user of a particular generation of the object
releases it by exiting the original calling program.

The library definition default/example only proposes a single
baseaddress and is silent with regard to whether multiple shared
objects should use different baseaddresses and, if so, how far apart
should two adjacent baseaddresses be. So, in short: Should we use
different baseaddresses for each library and how apart would they need
to be?

Jim Idle

unread,
Sep 3, 2008, 12:13:33 PM9/3/08
to jB...@googlegroups.com
You should use multiple base addresses because if there is an address overlap, the loader must map the DLL to an unused address space - when it does this, it copies it and so each separate process that uses it will make its own copy in memory and use up resources. The gap between base addresses should be 'big enough" - hence no comments about it. IN practice you can mke the separation vastly bigger then possible required address space.

It is a left over from DOS/early windows and is something that MS should really have got rid of.

There is however an easier way. which is to use the 'rebase' command. This is part of Windows SDKs and one of the tools that comes with VS. This is the recommended way because there is no good way to know that some other DLL you loaded on the system was randomly based to intersect with the base address you chose. The rebase command can start at a root directory and locate all .DLL files under that root, rebasing them so that they do not clash. In practice you only need to do this for DLLs that are loaded concurrently, so rebasing the jBASE install and your own DLLS is a good idea. Many installers put their DLLS in system32 and then rebase the whole of system32 (now you know why installing that tiny package takes so long).

The results are usually worth the effort, but use rebase rather than trying to guess.

Jim




Reply all
Reply to author
Forward
0 new messages