Solved

DLL/DPL: How to choose imagebase?

Posted on 2001-07-20
3
812 Views
Last Modified: 2008-02-01
It's about the imagebase linker param that defaults to $00400000.

For DLL's and DPL's I understand it's recommended to change it, in order to minimize load time and eventually memory consumption.

1. First of all, has anybody any experience about the efectiveness of changing this setting?
2. Can you suggest any policy for choosing the value?
3. Any potential problems when several apps are using the same DLL because it was loaded at its preferred address?
4. How do you manage the settings for different DLL's across all your pool of own-developed libraries? What about "collision" chances with other libraries already in the target system?

Thank you,
F.
0
Comment
Question by:fva
  • 2
3 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 100 total points
ID: 6303276
Hi F.

1.) Unless the app uses a large number of dll's, this has little affect, and then only on the load time.

2.) Per MSDN:

The system DLLs are currently based in memory from 0x70000000 to 0x78000000 (0x68000000 to 0x78000000 on MIPS). Therefore, you should base your DLLs from 0x60000000 to 0x68000000. One possible scheme is to choose a base address based on the first letter of the DLL name.

First letter Base address
A - C 0x60000000
D - F 0x61000000
G - I 0x62000000
J - L 0x63000000
M - O 0x64000000
P - R 0x65000000
S - U 0x66000000
V - X 0x67000000
Y - Z 0x68000000

It is best to base DLLs from the top of the address range down, instead of from the bottom up. Dynamic memory is allocated from the bottom up and if a DLL tries to load where dynamic memory has been allocated, it will be relocated, just as if a DLL was loaded at that address.

3.) No.

4.) Not sure if I follow the question, but windows will rebase the dll in memory if the image base address is in conflict. Answer 2 (above) covers the addresses for system dll's.

Russell



0
 
LVL 4

Author Comment

by:fva
ID: 6308172
Hi, thanks.

I admit, 4) it's actually a rephrase of 2)

I'll let some time open this, maybe I get other opinions, too.

F.
0
 
LVL 4

Author Comment

by:fva
ID: 6326229
And here are your points since nobody else cared to add any comment.

Thanks,
F.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 104
Strange behavior when a form is closed 6 51
Magic Software info 18 125
FMX and jaudiotracker playing memory stream 29 66
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now