Do that at your own risk.
It is not safe to arbitrarily set /LARGEADDRESSAWARE on executables you
did not write. LARGEADDRESSAWARE is a way for the programer to inform
the compiler, linker, and loader that the program does not make certain
classes of assumptions about pointers; *only* the programmer can make
that call, not end users.
If you set the flag on a program you did not write, and that program
*does* make the kinds of assumptions that are invalidated by large
pointers, then you just broke the program. Since Sun didn't see fit to
set that flag, you cannot assume the 32-bit VM doesn't make
small-pointer assumptions.
See <
http://blogs.msdn.com/oldnewthing/archive/2004/08/12/213468.aspx>
and the related articles for a more thorough explanation and
<
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5061380> for an RFE
to get it added to the VM. There are also a few threads about it on the
OpenJDK dev lists -- google around.
More practically, the limiting factor for the Windows 32-bit VM is not
the available address space, but the available *continuous* address
space. For implementation reasons, the Hotspot VM's heap must be
continuous in the process's address space. 32-bit Windows processes
(whether or not /3GB is in effect, and whether or not they are
/LARGEADDRESSAWARE) have a small gap in the usable address space right
above the 2GB mark, which prevents the VM from creating a continuous
region larger than 2GB. So, no 3GB heaps on 32-bit Windows Hotspot VMs
even if the VM becomes /LARGEADDRESSAWARE.
(In theory there's nothing preventing a 32-bit VM from having a 2 TB
heap, implemented using paging. However, it's a lot cheaper and easier
to buy 64-bit hardware and enjoy a massive, OS-managed address space
than it is to write your own memory manager.)
-o- Hide quoted text -
- Show quoted text -