-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P3
-
Affects Version/s: None
-
Component/s: hotspot
-
b17
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
|---|---|---|---|---|---|---|
| JDK-8007201 | 8 | Bengt Rutisson | P3 | Closed | Fixed | b75 |
| JDK-8017881 | 7u45 | Bengt Rutisson | P3 | Closed | Fixed | b01 |
| JDK-8007583 | 7u40 | Bengt Rutisson | P3 | Closed | Fixed | b13 |
| JDK-8006638 | hs24 | Bengt Rutisson | P3 | Closed | Fixed | b31 |
On my 8GB OSX laptop os::Bsd::initialize_system_info() sets up _physical_memory to be 140733629517824, which is 127TB.
Since we base for example the maximum Java heap size on os::physical_memory() which on BSD returns this value we get ~30GB max heap size even for just running "java -version".
Here is the code in os::Bsd::initialize_system_info() that returns a too large value:
mib[0] = CTL_HW;
mib[1] = HW_USERMEM;
len = sizeof(mem_val);
if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1)
_physical_memory = mem_val;
Somehow the sysctl() call sets mem_val to 140733629517824.
Impact=Medium since we normally don't crash but just use up much more memory than necessary (we don't commit the maximum heap size, but there are several data structures that are O(MaxHeapSize) in size.
Likelihood: High. Seem to happen on all OSX machine where I've tried it.
Workaround: Low. Set -Xmx on the command line.
ILW=MHL -> P3
Since we base for example the maximum Java heap size on os::physical_memory() which on BSD returns this value we get ~30GB max heap size even for just running "java -version".
Here is the code in os::Bsd::initialize_system_info() that returns a too large value:
mib[0] = CTL_HW;
mib[1] = HW_USERMEM;
len = sizeof(mem_val);
if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1)
_physical_memory = mem_val;
Somehow the sysctl() call sets mem_val to 140733629517824.
Impact=Medium since we normally don't crash but just use up much more memory than necessary (we don't commit the maximum heap size, but there are several data structures that are O(MaxHeapSize) in size.
Likelihood: High. Seem to happen on all OSX machine where I've tried it.
Workaround: Low. Set -Xmx on the command line.
ILW=MHL -> P3
- backported by
-
JDK-8006638 os::Bsd::initialize_system_info() sets _physical_memory too large
-
- Closed
-
-
JDK-8007201 os::Bsd::initialize_system_info() sets _physical_memory too large
-
- Closed
-
-
JDK-8007583 os::Bsd::initialize_system_info() sets _physical_memory too large
-
- Closed
-
-
JDK-8017881 os::Bsd::initialize_system_info() sets _physical_memory too large
-
- Closed
-