-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
11
-
x86_64
-
linux_debian_3.0
A DESCRIPTION OF THE PROBLEM :
The following program prints "ramSize = 0" on one of my machines:
```java
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBvaean;
public class Main {
private static OperatingSystemMXBean osMXBean;
public static void main(String[] args) {
osMXBean = ManagementFactory.getOperatingSystemMXBean();
long ramSize = ((com.sun.management.OperatingSystemMXBean) osMXBean).getTotalPhysicalMemorySize();
System.out.println("ramSize = " + ramSize);
}
}
```
Interestingly, this really only happens on this one machine; all other machines report correct values. On that one machine, 0 is returned also if I run inside Docker, both with OpenJDK 8 and 11. With OpenJDK 16 and 17 (current 11-jdk-slim-buster docker tags), the correct value is displayed.
Some information about the system; I can report more if told what to report:
```
$ uname -ar
Linux bach01 4.14.150-U #1 SMP Sun Oct 20 05:44:32 CEST 2019 x86_64 GNU/Linux
$ cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
```
The following program prints "ramSize = 0" on one of my machines:
```java
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBvaean;
public class Main {
private static OperatingSystemMXBean osMXBean;
public static void main(String[] args) {
osMXBean = ManagementFactory.getOperatingSystemMXBean();
long ramSize = ((com.sun.management.OperatingSystemMXBean) osMXBean).getTotalPhysicalMemorySize();
System.out.println("ramSize = " + ramSize);
}
}
```
Interestingly, this really only happens on this one machine; all other machines report correct values. On that one machine, 0 is returned also if I run inside Docker, both with OpenJDK 8 and 11. With OpenJDK 16 and 17 (current 11-jdk-slim-buster docker tags), the correct value is displayed.
Some information about the system; I can report more if told what to report:
```
$ uname -ar
Linux bach01 4.14.150-U #1 SMP Sun Oct 20 05:44:32 CEST 2019 x86_64 GNU/Linux
$ cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
```