Memory configuration
Arttu Soininen
Memory configuration
• 32 bit operating system has a 4GB address space
• Windows reserves 2GB of that
• Application can use 2GB of RAM
• MicroStation + MDL applications share the
same 2GB
• Windows fragments the memory space
• Typical configuration has:
– Largest free block in MicroStation J about 700 MB
– Largest free block in MicroStation SE about 900 MB
– Largest free block in MicroStation V8 about 800 MB
Cause of fragmentation
• Each DLL has a base address stored in the DLL
file
• Windows loads DLLs to their image base address
• Windows loads system DLLs into application
memory space areas:
– 0x00000000 - 0x0FFFFFFF (character maps etc)
– 0x68000000 - 0x7FFFFFFF (various services)
• Application and system utility writers have to
specify a base address for DLLs they write
• Nobody coordinates the memory use
Testing your configuration
• Test TerraScan key-in command: development
memory
– shows available memory areas in MicroStation Text Window
– first row shows the largest free area
• Download Process explorer from
www.sysinternals.com
• Run while MicroStation is running
– select MicroStation in upper pane
– select View / Lower pane view / DLLs menu item
– set lower pane to display at least Base, Size and Path
– see what DLLs occupy memory area 0x10000000 -
0x5FFFFFFF
Improving memory
configuration
• Find/download REBASE.EXE
• You can:
– Disable or uninstall memory resident utilities which
occupy memory area 0x10000000 - 0x5FFFFFFF
– Rebase memory resident utility DLLs (tricky)
– Rebase MicroStation SE DLLs
• MicroStation SE:
– Clear memory area 0x1000000 - 0x5FFFFFFF /
0x67FFFFFF
– Can reach 1600 MB continuous memory area
• MicroStation V8:
– Can not rebase MicroStation DLLs
– Can reach 1200 MB continuous memory area
Rebasing MicroStation SE
DLLs
• You can rebase DLLs when MicroStation is
not running
– \mdlsys\required\mptools.dll
– \mdlsys\asneeded\olecntr.dll
– others if needed
• Example commands:
– rebase -b 0x67000000 olecntr.dll
– rebase -b 0x67080000 mptools.dll
Windows XP Pro SP2
• Supports 3GB application memory space
• Gives an additional 1 GB area for an application
• Modify c:\boot.ini to have /3GB boot option:
[boot loader]
timeout=15
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP Pro 3GB" /3GB /fastdetect /NoExecute=OptIn
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP Professional" /fastdetect /NoExecute=OptIn
• Modify MicroStation executable with command:
editbin /LARGEADDRESSAWARE ustation.exe
• editbin.exe comes with Visual Studio 6.0 or
download MASM32 from www.masm32.com
Windows XP SP2
• Windows XP Service Pack 2 has a badly
placed DLL
• Start Windows in Safe Mode with Command
Prompt
• Enter commands:
– cd \terra
– copy c:\windows\system32\xpsp2res.dll c:\terra
– rebase -b 0x70000000 xpsp2res.dll
– move c:\windows\system32\xpsp2res.dll c:\
– copy xpsp2res.dll c:\windows\system32
• Restart Windows
Windows XP x64
• Supports 4GB application memory space
• Gives an additional 2 GB area for an
application
• Modify MicroStation executable with
command:
editbin /LARGEADDRESSAWARE ustation.exe
• editbin.exe comes with Visual Studio 6.0 or
download MASM32 from www.masm32.com
• Best Windows for memory hungry 32 bit
software!