JDK-5103372 : (bf) Allow larger size of NIO buffer space (greater than ~2047 MB)
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,windows_xp
  • CPU: generic,itanium
  • Submitted: 2004-09-16
  • Updated: 2006-06-22
  • Resolved: 2006-06-22
Related Reports
Duplicate :  
Description
Name: rmT116609			Date: 09/16/2004


A DESCRIPTION OF THE REQUEST :
The total size of memory available via ByteBuffer.allocateDirect is controlled by the JVM command line parameter -XX:MaxDirectMemorySize, and in 5.0-RC on 64-bit Windows XP defaults to a value of around 900 MB.  By specifying a value on the command line you can raise this space to 2047 MB.  However, 2047 MB appears to be the largest value allowed, and doesn't allow allocating very large NIO buffers in the very large memroy space available to 64-bit applications.

JUSTIFICATION :
  To allow NIO buffer sizes that are more than a tiny fraction of the available process address space.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Allowable NIO buffer space either unlimited or with a reasonable limit compared to amount of process address space.
ACTUAL -
NIO buffer space limited to 2047 MB max.
(Incident Review ID: 310935) 
======================================================================

Comments
EVALUATION I don't think we can ever support buffers larger than 2GB, because of the fundamental limitation that sizes of Java objects and arrays are constrained to be of type `int'. It may be possible to specify a larger value for *total* memory available to direct byte buffers, but each buffer will likely always be limited in size. ###@###.### 2004-09-16
16-09-2004