Thread overview | ||||||
---|---|---|---|---|---|---|
|
April 15, 2009 [Issue 2837] New: OPTLINK and LARGEADDRESSAWARE | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2837 Summary: OPTLINK and LARGEADDRESSAWARE Product: D Version: unspecified Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: Optlink AssignedTo: bugzilla@digitalmars.com ReportedBy: bugzilla@digitalmars.com Vladimir Panteleev writes: It seems that OPTLINK doesn't support the IMAGE_FILE_LARGE_ADDRESS_AWARE flag (enabled with /LARGEADDRESSAWARE when using Microsoft Link), even though the D runtime seems to support it. Consider this simple program: ----------------------------- import std.stdio; void main() { ubyte[][4096] a; // GC anchor for (int i=0;;i++) { writefln(i); a[i].length = 1024*1024; } } ----------------------------- This program crashes when it tries to allocate the 1618th megabyte, even though my PC has 6 GB of RAM and the 32-bit address space allows for much more. I've patched the executable and enabled the IMAGE_FILE_LARGE_ADDRESS_AWARE flag. This flag is 0x0020 in the "Characteristics" field in the IMAGE_FILE_HEADER structure. In OPTLINK-generated executables, one can enable this flag manually by changing byte 0x76 from 0x8E to 0xAE in the executable file. The result - the program can now allocate 3319 megabytes on my machine, thus practically doubling its address space. (Why is it still not anywhere near the theoretical limit?) I've patched my copy of the linker until the official linker is updated. If anyone wants to use more than 2 (or 1.6?) GB in their DMD/Windows programs, change the byte at 0x3CF0D in link.exe from 0x8F to 0xAF. -- |
February 21, 2011 [Issue 2837] OPTLINK and LARGEADDRESSAWARE | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2837 Vladimir <thecybershadow@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dsimcha@yahoo.com --- Comment #1 from Vladimir <thecybershadow@gmail.com> 2011-02-21 10:25:24 PST --- *** Issue 5631 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 01, 2012 [Issue 2837] OPTLINK and LARGEADDRESSAWARE | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2837 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yebblies@gmail.com --- Comment #2 from yebblies <yebblies@gmail.com> 2012-11-01 19:26:47 EST --- Is there any reason we can't just have IMAGE_FILE_LARGE_ADDRESS_AWARE set by default? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 02, 2012 [Issue 2837] OPTLINK and LARGEADDRESSAWARE | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2837 --- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2012-11-02 01:30:36 PDT --- Generally, a program that consumes all of memory can bring the system to a halt. So only if your program really needs it should it be turned on. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation