On some Linux kernels, the unlimited value of memory.limit_in_bytes is returned as ULONG_MAX, not LONG_MAX.
- .../nightly $ cat //sys/fs/cgroup/memory/memory.limit_in_bytes
18446744073709551615
In those cases, java -XshowSettings will fail:
java -XshowSettings
....
Operating System Metrics:
Provider: cgroupv1
Effective CPU Count: 8
CPU Period: 100000us
CPU Quota: -1
CPU Shares: -1
List of Processors, 8 total:
0 1 2 3 4 5 6 7
List of Effective Processors, 0 total:
List of Memory Nodes, 1 total:
0
List of Available Memory Nodes, 0 total:
CPUSet Memory Pressure Enabled: false
Exception in thread "main" java.lang.NumberFormatException: For input string: "18446744073709551615"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Long.parseLong(Long.java:692)
at java.base/java.lang.Long.parseLong(Long.java:817)
at java.base/jdk.internal.platform.cgroupv1.SubSystem.getLongValue(SubSystem.java:106)
at java.base/jdk.internal.platform.cgroupv1.Metrics.getMemoryLimit(Metrics.java:374)
at java.base/sun.launcher.LauncherHelper.printSystemMetrics(LauncherHelper.java:385)
at java.base/sun.launcher.LauncherHelper.showSettings(LauncherHelper.java:180)