.NET Framework Bookmark and Share   
 index > Building Development and Diagnostic Tools for .Net > dll base address
 

dll base address

Whats the point of the 'DLL base address' field found in Advanced Compiler options when of Visual Studio:

  1. this is all managed code
  2. the OS shuffles programs around in memory and changes their base address automatically anyway.
Mr Johansen

There's a good discussion of whyletting the OS shuffle your program around can be badand how it applies to managed code here: http://msdn.microsoft.com/msdnmag/issues/06/02/CLRInsideOut/default.aspx#S6

The short version is it applies to managed code when you create a native image using NGEN, and when the OS does the shuffling it's a very expensive operation performance-wise, with effects that last beyond just startup time.

HTH,

Jonathan

Jonathan Keljo - Microsoft

This maps to the /baseaddress compiler switch. See http://msdn2.microsoft.com/en-us/library/b1awdekb(VS.90).aspxfor more about that.

1. Managed code still is packaged in dlls and still needs to occupy some spot in memory.

2. The OS can indeed shuffle where dlls get loaded if there are collisions. But each DLL gets to request a "default" base address. If you have a group of dlls, you can choose their defaults such that they load together without having collisions. Having to load a module at something other than the default base address is extra work (it requires touching up relocations). This option is an optimization for advanced scenarios.

You can read more about DLL rebasing here: http://blogs.msdn.com/larryosterman/archive/2004/07/06/174516.aspx or by searching around for terms like module, rebase, fixup, reloc.

Mike Stall - MSFT

There's a good discussion of whyletting the OS shuffle your program around can be badand how it applies to managed code here: http://msdn.microsoft.com/msdnmag/issues/06/02/CLRInsideOut/default.aspx#S6

The short version is it applies to managed code when you create a native image using NGEN, and when the OS does the shuffling it's a very expensive operation performance-wise, with effects that last beyond just startup time.

HTH,

Jonathan

Jonathan Keljo - Microsoft

This maps to the /baseaddress compiler switch. See http://msdn2.microsoft.com/en-us/library/b1awdekb(VS.90).aspxfor more about that.

1. Managed code still is packaged in dlls and still needs to occupy some spot in memory.

2. The OS can indeed shuffle where dlls get loaded if there are collisions. But each DLL gets to request a "default" base address. If you have a group of dlls, you can choose their defaults such that they load together without having collisions. Having to load a module at something other than the default base address is extra work (it requires touching up relocations). This option is an optimization for advanced scenarios.

You can read more about DLL rebasing here: http://blogs.msdn.com/larryosterman/archive/2004/07/06/174516.aspx or by searching around for terms like module, rebase, fixup, reloc.

Mike Stall - MSFT

You can use google to search for other answers

Custom Search

More Threads

• Sequence diagram generation from a .Net assembly
• Mdbg Sample Updated
• Application Domain (Application Pool) dump
• Compiling a single .CS File In a Project
• c# to x86 code
• Compiling for Production: Release vs. Debug
• Is there anything like View Source / GetText in ICorDebug API?
• why I cannot debug or step into some function?
• MS agent speak or speech library speak should run asynchronously
• why does reflection.emit work with dynamic assemblies only.