Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2225815 | 8 | David Holmes | P4 | Closed | Fixed | b44 |
JDK-8018256 | 7u45 | David Holmes | P4 | Closed | Fixed | b01 |
JDK-8002565 | 7u40 | David Holmes | P4 | Closed | Fixed | b01 |
JDK-2226271 | 7u6 | David Holmes | P4 | Closed | Fixed | b16 |
JDK-2225326 | hs24 | David Holmes | P3 | Closed | Fixed | b14 |
Reported by Chris Dennis on the jdk7u mailing list
"I believe that when the Mac OS X support was merged in to the jdk7u-dev forest that a mistake was made regarding Visual Studio's lack of inttypes.h. The symptom of this bug can be seen in the following output:
$ java -showversion -d64 -XX:MaxDirectMemorySize=4g OffHeapAllocationTest
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
Command Line: [-XX:MaxDirectMemorySize=4g]
sun.misc.VM.maxDirectMemory() = 0
java.nio.Bits.maxMemory = 0
Experimenting with different MaxDirectMemorySize values clearly shows this to be a 32-bit wrap-around issue. When Mac OS X support was merged in, the INTX_FORMAT which is used to write the MaxDirectMemorySize global in to the system properties was modified to use PRIdPTR from inttypes.h. As Visual Studio lacks inttypes.h, definitions for this (and the other associated format specifiers) were added to globalDefinitions_visCPP.hpp. However the definitions added are only correct for a 32-bit system. I believe the following changeset corrects that error (no Windows access prevents me from verifying this fix however)."
Reproducer
public class TestMaxDirectMemory {
public static void main(String[] args) {
System.out.println(sun.misc.VM.maxDirectMemory());
}
}
When run with -XX:MaxDirectMemorySize=4g on a 64bit Windows 1.7.0_04 VM it will print 0 since the high 32bits will get dropped.
"I believe that when the Mac OS X support was merged in to the jdk7u-dev forest that a mistake was made regarding Visual Studio's lack of inttypes.h. The symptom of this bug can be seen in the following output:
$ java -showversion -d64 -XX:MaxDirectMemorySize=4g OffHeapAllocationTest
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
Command Line: [-XX:MaxDirectMemorySize=4g]
sun.misc.VM.maxDirectMemory() = 0
java.nio.Bits.maxMemory = 0
Experimenting with different MaxDirectMemorySize values clearly shows this to be a 32-bit wrap-around issue. When Mac OS X support was merged in, the INTX_FORMAT which is used to write the MaxDirectMemorySize global in to the system properties was modified to use PRIdPTR from inttypes.h. As Visual Studio lacks inttypes.h, definitions for this (and the other associated format specifiers) were added to globalDefinitions_visCPP.hpp. However the definitions added are only correct for a 32-bit system. I believe the following changeset corrects that error (no Windows access prevents me from verifying this fix however)."
Reproducer
public class TestMaxDirectMemory {
public static void main(String[] args) {
System.out.println(sun.misc.VM.maxDirectMemory());
}
}
When run with -XX:MaxDirectMemorySize=4g on a 64bit Windows 1.7.0_04 VM it will print 0 since the high 32bits will get dropped.
- backported by
-
JDK-2225326 32/64 bit type issues on Windows after Mac OS X port
-
- Closed
-
-
JDK-2225815 32/64 bit type issues on Windows after Mac OS X port
-
- Closed
-
-
JDK-2226271 32/64 bit type issues on Windows after Mac OS X port
-
- Closed
-
-
JDK-8002565 32/64 bit type issues on Windows after Mac OS X port
-
- Closed
-
-
JDK-8002566 32/64 bit type issues on Windows after Mac OS X port
-
- Closed
-
-
JDK-8018256 32/64 bit type issues on Windows after Mac OS X port
-
- Closed
-
(1 backported by)