JDK-8217338 : [Containers] Improve systemd slice memory limit support
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8u192,11.0.2,12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_redhat_8.0
  • Submitted: 2019-01-17
  • Updated: 2024-06-04
  • Resolved: 2019-04-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 8 Other
11.0.10-oracleFixed 13 b18Fixed 8u281Fixed openjdk8u292Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
From http://mail.openjdk.java.net/pipermail/hotspot-dev/2019-January/036292.html:

Current container awareness for OpenJDK seems to work for systemd
slices too, on some systems. To be precise, this works for older
Kernels e.g. 3.10. However, we've noticed that this breaks for newer
Kernel versions[1] such as the one in F28, currently 4.19.14-200. If
the container support would also look at hierarchical memory limits
exposed via memory.stat in the cgroup file system, it would again
work[2]. A proof of concept implementation is here:

http://cr.openjdk.java.net/~sgehwolf/webrevs/container-systemd-slice-01/webrev/

This enhancement wouldn't change any existing container memory limit
detection as it only kicks in when all other look-ups determined that
there is no limit in place. I've verified this by running Docker
container tests. The idea is to look for hierarchical_memory_limit and
hierarchical_memsw_limit lines in the memory.stat file of the cgroup
tree.

Would it be possible to consider such an enhancement upstream? If so,
I'll file a bug and propose it for review.

This issue has been originally raised here:
https://bugzilla.redhat.com/show_bug.cgi?id=1509371

[1] Java process gets killed by oom killer.
    See: http://cr.openjdk.java.net/~sgehwolf/webrevs/container-systemd-slice-01/before.txt
[2] Java process throws OutOfMemoryError as expected.
    See: http://cr.openjdk.java.net/~sgehwolf/webrevs/container-systemd-slice-01/after.txt
Comments
See JDK-8322420 which reworks this in a more generic way (including cg v2 support).
31-05-2024

Fix Request (OpenJDK 8u): Please approve backporting this to 8u. Oracle backported it too and it's needed as a dependency for JDK-8250984 also intended for backport. On it's own merit it improves memory limit support within systemd slices. This has been in JDK 11 since 11.0.7 and we aren't aware of any issues. The patch doesn't apply cleanly due to jdk/hotspot repository split and no UL. Review approved by Paul Hohensee. https://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8217338/jdk8/02/ RFR: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-November/012946.html Approval: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-December/013158.html
01-12-2020

I'm working on an OpenJDK 8u backport of this. It depends on JDK-8217766 (also slated for 8u) so that it applies better for the hotspot files. JDK-8220579 is needed for the systemd slice to work correctly. Getting this fix in also helps for other parity patches, like JDK-8250984. Example demonstrating the issue: $ cat /etc/systemd/system/user-cg.slice [Unit] Description=Demo cgroup Before=slices.target [Slice] MemoryAccounting=true MemoryLimit=100M $ sudo systemctl daemon-reload && sudo systemctl restart user-cg.slice && sudo systemd-run --slice user-cg.slice --scope bash Before: [root@foo ]# java -XshowSettings:system -version 2>&1 | grep 'Memory Limit' Memory Limit: Unlimited Kernel Memory Limit: Unlimited TCP Memory Limit: Unlimited [root@foo ]# java -XX:+UnlockDiagnosticVMOptions -XX:+PrintContainerInfo -version 2>&1 | grep -i 'Memory Limit' Memory Limit is: 9223372036854771712 Memory Limit is: Unlimited Memory Limit is: 9223372036854771712 Memory Limit is: Unlimited container memory limit unlimited: -1, using host value Memory Limit is: 9223372036854771712 Memory Limit is: Unlimited container memory limit unlimited: -1, using host value After: [root@foo ]# java -XshowSettings:system -version 2>&1 | grep 'Memory Limit' Memory Limit: 100.00M Kernel Memory Limit: Unlimited TCP Memory Limit: Unlimited [root@foo ]# java -XX:+UnlockDiagnosticVMOptions -XX:+PrintContainerInfo -version 2>&1 | grep -i 'Memory Limit' Memory Limit is: 9223372036854771712 Non-Hierarchical Memory Limit is: Unlimited Hierarchical Memory Limit is: 104857600 Memory Limit is: 104857600 Memory Limit is: 9223372036854771712 Non-Hierarchical Memory Limit is: Unlimited Hierarchical Memory Limit is: 104857600 Memory Limit is: 9223372036854771712 Non-Hierarchical Memory Limit is: Unlimited Hierarchical Memory Limit is: 104857600
01-12-2020

Fix request (11u) I would like to downport this for parity with 11.0.7-oracle. Applies clean. Actually I accidentially pushed this already while in discussion with Severin about this. Naturally, I'll backout the change if not accepted for downport. See also pushed change: http://hg.openjdk.java.net/jdk-updates/jdk11u-dev/rev/2173ddc0b886 Mail thread: http://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-January/002336.html
08-01-2020

Removing fix approval as Severin mentioned that he's currently not actively working on this backport. Please add fix request labels again once this item is ready to go.
16-09-2019

This is a substantial change. Are you sure that it is really an appropriate backport?
30-07-2019

Fix Request (OpenJDK 11u): Please approve backporting this to OpenJDK 11. The patch applies as-is once JDK-8217766 has been backported as well. In terms of compatibility this should be fine as the hierarchical memory limit is only being checked if other limits are unlimited. Testing: Manual with relevant systemd slice config on Linux x86_64.
15-07-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/1c242c2d037f User: sgehwolf Date: 2019-04-18 15:09:46 +0000
18-04-2019

Latest webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8217338/05/webrev/
25-03-2019

Latest webrev (including Metrics.java support): http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8217338/02/webrev/ This depends on JDK-8220579
13-03-2019

Kernels of at least 4.18+ are affected (possibly some earlier kernels too).
12-03-2019

Ubuntu 18.10 with kernel 4.18 is affected: sgehwolf@ubuntu-18-10:~$ sudo systemctl daemon-reload && sudo systemctl restart user-cg.slice && sudo systemd-run --slice user-cg.slice --scope bash Running scope as unit: run-rdd6e130656124a71b50c8ebfe6740de1.scope root@ubuntu-18-10:~# java -Xlog:os+container=trace -version [0.000s][trace][os,container] OSContainer::init: Initializing Container Support [0.002s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0.002s][trace][os,container] Memory Limit is: 9223372036854771712 [0.002s][trace][os,container] Memory Limit is: Unlimited [0.002s][trace][os,container] Path to /cpu.cfs_quota_us is /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us [0.002s][trace][os,container] CPU Quota is: -1 [0.002s][trace][os,container] Path to /cpu.cfs_period_us is /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us [0.002s][trace][os,container] CPU Period is: 100000 [0.002s][trace][os,container] Path to /cpu.shares is /sys/fs/cgroup/cpu,cpuacct/cpu.shares [0.002s][trace][os,container] CPU Shares is: 1024 [0.002s][trace][os,container] OSContainer::active_processor_count: 2 [0.002s][trace][os,container] Path to /cpu.cfs_quota_us is /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us [0.002s][trace][os,container] CPU Quota is: -1 [0.002s][trace][os,container] Path to /cpu.cfs_period_us is /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us [0.002s][trace][os,container] CPU Period is: 100000 [0.002s][trace][os,container] Path to /cpu.shares is /sys/fs/cgroup/cpu,cpuacct/cpu.shares [0.002s][trace][os,container] CPU Shares is: 1024 [0.002s][trace][os,container] OSContainer::active_processor_count: 2 [0.002s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0.002s][trace][os,container] Memory Limit is: 9223372036854771712 [0.002s][trace][os,container] Memory Limit is: Unlimited [0.002s][debug][os,container] container memory limit unlimited: -1, using host value [0.002s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0.002s][trace][os,container] Memory Limit is: 9223372036854771712 [0.002s][trace][os,container] Memory Limit is: Unlimited [0.002s][debug][os,container] container memory limit unlimited: -1, using host value [0.003s][trace][os,container] Path to /cpu.cfs_quota_us is /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us [0.003s][trace][os,container] CPU Quota is: -1 [0.003s][trace][os,container] Path to /cpu.cfs_period_us is /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us [0.003s][trace][os,container] CPU Period is: 100000 [0.003s][trace][os,container] Path to /cpu.shares is /sys/fs/cgroup/cpu,cpuacct/cpu.shares [0.003s][trace][os,container] CPU Shares is: 1024 [0.003s][trace][os,container] OSContainer::active_processor_count: 2 [0.014s][trace][os,container] Path to /cpu.cfs_quota_us is /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us [0.014s][trace][os,container] CPU Quota is: -1 [0.014s][trace][os,container] Path to /cpu.cfs_period_us is /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us [0.014s][trace][os,container] CPU Period is: 100000 [0.014s][trace][os,container] Path to /cpu.shares is /sys/fs/cgroup/cpu,cpuacct/cpu.shares [0.014s][trace][os,container] CPU Shares is: 1024 [0.014s][trace][os,container] OSContainer::active_processor_count: 2 [0,026s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,026s][trace][os,container] Memory Limit is: 9223372036854771712 [0,026s][trace][os,container] Memory Limit is: Unlimited [0,026s][debug][os,container] container memory limit unlimited: -1, using host value [0,027s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,028s][trace][os,container] Memory Limit is: 9223372036854771712 [0,028s][trace][os,container] Memory Limit is: Unlimited [0,028s][debug][os,container] container memory limit unlimited: -1, using host value [0,028s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,028s][trace][os,container] Memory Limit is: 9223372036854771712 [0,028s][trace][os,container] Memory Limit is: Unlimited [0,028s][debug][os,container] container memory limit unlimited: -1, using host value [0,028s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,028s][trace][os,container] Memory Limit is: 9223372036854771712 [0,028s][trace][os,container] Memory Limit is: Unlimited [0,028s][debug][os,container] container memory limit unlimited: -1, using host value [0,028s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,028s][trace][os,container] Memory Limit is: 9223372036854771712 [0,028s][trace][os,container] Memory Limit is: Unlimited [0,028s][debug][os,container] container memory limit unlimited: -1, using host value [0,029s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,029s][trace][os,container] Memory Limit is: 9223372036854771712 [0,029s][trace][os,container] Memory Limit is: Unlimited [0,029s][debug][os,container] container memory limit unlimited: -1, using host value [0,029s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,029s][trace][os,container] Memory Limit is: 9223372036854771712 [0,029s][trace][os,container] Memory Limit is: Unlimited [0,029s][debug][os,container] container memory limit unlimited: -1, using host value [0,029s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,029s][trace][os,container] Memory Limit is: 9223372036854771712 [0,029s][trace][os,container] Memory Limit is: Unlimited [0,029s][debug][os,container] container memory limit unlimited: -1, using host value [0,029s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,029s][trace][os,container] Memory Limit is: 9223372036854771712 [0,029s][trace][os,container] Memory Limit is: Unlimited [0,029s][debug][os,container] container memory limit unlimited: -1, using host value [0,029s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,029s][trace][os,container] Memory Limit is: 9223372036854771712 [0,029s][trace][os,container] Memory Limit is: Unlimited [0,029s][debug][os,container] container memory limit unlimited: -1, using host value [0,030s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,030s][trace][os,container] Memory Limit is: 9223372036854771712 [0,030s][trace][os,container] Memory Limit is: Unlimited [0,030s][debug][os,container] container memory limit unlimited: -1, using host value [0,030s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,030s][trace][os,container] Memory Limit is: 9223372036854771712 [0,030s][trace][os,container] Memory Limit is: Unlimited [0,030s][debug][os,container] container memory limit unlimited: -1, using host value [0,030s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,030s][trace][os,container] Memory Limit is: 9223372036854771712 [0,030s][trace][os,container] Memory Limit is: Unlimited [0,030s][debug][os,container] container memory limit unlimited: -1, using host value [0,030s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,030s][trace][os,container] Memory Limit is: 9223372036854771712 [0,030s][trace][os,container] Memory Limit is: Unlimited [0,030s][debug][os,container] container memory limit unlimited: -1, using host value [0,031s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,031s][trace][os,container] Memory Limit is: 9223372036854771712 [0,031s][trace][os,container] Memory Limit is: Unlimited [0,031s][debug][os,container] container memory limit unlimited: -1, using host value [0,031s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,031s][trace][os,container] Memory Limit is: 9223372036854771712 [0,031s][trace][os,container] Memory Limit is: Unlimited [0,031s][debug][os,container] container memory limit unlimited: -1, using host value [0,031s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,031s][trace][os,container] Memory Limit is: 9223372036854771712 [0,031s][trace][os,container] Memory Limit is: Unlimited [0,031s][debug][os,container] container memory limit unlimited: -1, using host value [0,031s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,031s][trace][os,container] Memory Limit is: 9223372036854771712 [0,031s][trace][os,container] Memory Limit is: Unlimited [0,031s][debug][os,container] container memory limit unlimited: -1, using host value [0,031s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,031s][trace][os,container] Memory Limit is: 9223372036854771712 [0,031s][trace][os,container] Memory Limit is: Unlimited [0,031s][debug][os,container] container memory limit unlimited: -1, using host value [0,031s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,031s][trace][os,container] Memory Limit is: 9223372036854771712 [0,031s][trace][os,container] Memory Limit is: Unlimited [0,031s][debug][os,container] container memory limit unlimited: -1, using host value [0,031s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,031s][trace][os,container] Memory Limit is: 9223372036854771712 [0,032s][trace][os,container] Memory Limit is: Unlimited [0,032s][debug][os,container] container memory limit unlimited: -1, using host value [0,032s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,032s][trace][os,container] Memory Limit is: 9223372036854771712 [0,032s][trace][os,container] Memory Limit is: Unlimited [0,032s][debug][os,container] container memory limit unlimited: -1, using host value [0,034s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,034s][trace][os,container] Memory Limit is: 9223372036854771712 [0,034s][trace][os,container] Memory Limit is: Unlimited [0,034s][debug][os,container] container memory limit unlimited: -1, using host value [0,034s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,034s][trace][os,container] Memory Limit is: 9223372036854771712 [0,034s][trace][os,container] Memory Limit is: Unlimited [0,034s][debug][os,container] container memory limit unlimited: -1, using host value [0,036s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,036s][trace][os,container] Memory Limit is: 9223372036854771712 [0,036s][trace][os,container] Memory Limit is: Unlimited [0,036s][debug][os,container] container memory limit unlimited: -1, using host value [0,036s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,036s][trace][os,container] Memory Limit is: 9223372036854771712 [0,036s][trace][os,container] Memory Limit is: Unlimited [0,036s][debug][os,container] container memory limit unlimited: -1, using host value [0,037s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,037s][trace][os,container] Memory Limit is: 9223372036854771712 [0,037s][trace][os,container] Memory Limit is: Unlimited [0,037s][debug][os,container] container memory limit unlimited: -1, using host value [0,037s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,037s][trace][os,container] Memory Limit is: 9223372036854771712 [0,037s][trace][os,container] Memory Limit is: Unlimited [0,037s][debug][os,container] container memory limit unlimited: -1, using host value [0,037s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,037s][trace][os,container] Memory Limit is: 9223372036854771712 [0,037s][trace][os,container] Memory Limit is: Unlimited [0,037s][debug][os,container] container memory limit unlimited: -1, using host value [0,037s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,037s][trace][os,container] Memory Limit is: 9223372036854771712 [0,037s][trace][os,container] Memory Limit is: Unlimited [0,037s][debug][os,container] container memory limit unlimited: -1, using host value [0,038s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,038s][trace][os,container] Memory Limit is: 9223372036854771712 [0,038s][trace][os,container] Memory Limit is: Unlimited [0,038s][debug][os,container] container memory limit unlimited: -1, using host value [0,038s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,038s][trace][os,container] Memory Limit is: 9223372036854771712 [0,038s][trace][os,container] Memory Limit is: Unlimited [0,038s][debug][os,container] container memory limit unlimited: -1, using host value [0,039s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,039s][trace][os,container] Memory Limit is: 9223372036854771712 [0,039s][trace][os,container] Memory Limit is: Unlimited [0,039s][debug][os,container] container memory limit unlimited: -1, using host value [0,039s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,039s][trace][os,container] Memory Limit is: 9223372036854771712 [0,039s][trace][os,container] Memory Limit is: Unlimited [0,039s][debug][os,container] container memory limit unlimited: -1, using host value [0,039s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,039s][trace][os,container] Memory Limit is: 9223372036854771712 [0,039s][trace][os,container] Memory Limit is: Unlimited [0,039s][debug][os,container] container memory limit unlimited: -1, using host value [0,040s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,040s][trace][os,container] Memory Limit is: 9223372036854771712 [0,040s][trace][os,container] Memory Limit is: Unlimited [0,040s][debug][os,container] container memory limit unlimited: -1, using host value [0,041s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,041s][trace][os,container] Memory Limit is: 9223372036854771712 [0,041s][trace][os,container] Memory Limit is: Unlimited [0,041s][debug][os,container] container memory limit unlimited: -1, using host value [0,041s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,041s][trace][os,container] Memory Limit is: 9223372036854771712 [0,041s][trace][os,container] Memory Limit is: Unlimited [0,041s][debug][os,container] container memory limit unlimited: -1, using host value [0,041s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,041s][trace][os,container] Memory Limit is: 9223372036854771712 [0,041s][trace][os,container] Memory Limit is: Unlimited [0,041s][debug][os,container] container memory limit unlimited: -1, using host value [0,041s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,042s][trace][os,container] Memory Limit is: 9223372036854771712 [0,042s][trace][os,container] Memory Limit is: Unlimited [0,042s][debug][os,container] container memory limit unlimited: -1, using host value [0,042s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,042s][trace][os,container] Memory Limit is: 9223372036854771712 [0,042s][trace][os,container] Memory Limit is: Unlimited [0,042s][debug][os,container] container memory limit unlimited: -1, using host value [0,042s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,042s][trace][os,container] Memory Limit is: 9223372036854771712 [0,042s][trace][os,container] Memory Limit is: Unlimited [0,042s][debug][os,container] container memory limit unlimited: -1, using host value [0,042s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,042s][trace][os,container] Memory Limit is: 9223372036854771712 [0,042s][trace][os,container] Memory Limit is: Unlimited [0,042s][debug][os,container] container memory limit unlimited: -1, using host value [0,042s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,042s][trace][os,container] Memory Limit is: 9223372036854771712 [0,042s][trace][os,container] Memory Limit is: Unlimited [0,042s][debug][os,container] container memory limit unlimited: -1, using host value [0,042s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,042s][trace][os,container] Memory Limit is: 9223372036854771712 [0,042s][trace][os,container] Memory Limit is: Unlimited [0,042s][debug][os,container] container memory limit unlimited: -1, using host value [0,042s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,043s][trace][os,container] Memory Limit is: 9223372036854771712 [0,043s][trace][os,container] Memory Limit is: Unlimited [0,043s][debug][os,container] container memory limit unlimited: -1, using host value [0,043s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,044s][trace][os,container] Memory Limit is: 9223372036854771712 [0,044s][trace][os,container] Memory Limit is: Unlimited [0,044s][debug][os,container] container memory limit unlimited: -1, using host value [0,044s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,044s][trace][os,container] Memory Limit is: 9223372036854771712 [0,044s][trace][os,container] Memory Limit is: Unlimited [0,044s][debug][os,container] container memory limit unlimited: -1, using host value [0,044s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,044s][trace][os,container] Memory Limit is: 9223372036854771712 [0,044s][trace][os,container] Memory Limit is: Unlimited [0,044s][debug][os,container] container memory limit unlimited: -1, using host value [0,045s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,045s][trace][os,container] Memory Limit is: 9223372036854771712 [0,045s][trace][os,container] Memory Limit is: Unlimited [0,045s][debug][os,container] container memory limit unlimited: -1, using host value [0,046s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,046s][trace][os,container] Memory Limit is: 9223372036854771712 [0,046s][trace][os,container] Memory Limit is: Unlimited [0,046s][debug][os,container] container memory limit unlimited: -1, using host value [0,046s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,046s][trace][os,container] Memory Limit is: 9223372036854771712 [0,046s][trace][os,container] Memory Limit is: Unlimited [0,046s][debug][os,container] container memory limit unlimited: -1, using host value [0,050s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,050s][trace][os,container] Memory Limit is: 9223372036854771712 [0,050s][trace][os,container] Memory Limit is: Unlimited [0,050s][debug][os,container] container memory limit unlimited: -1, using host value [0,050s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,050s][trace][os,container] Memory Limit is: 9223372036854771712 [0,050s][trace][os,container] Memory Limit is: Unlimited [0,050s][debug][os,container] container memory limit unlimited: -1, using host value [0,050s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,050s][trace][os,container] Memory Limit is: 9223372036854771712 [0,050s][trace][os,container] Memory Limit is: Unlimited [0,050s][debug][os,container] container memory limit unlimited: -1, using host value [0,050s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,051s][trace][os,container] Memory Limit is: 9223372036854771712 [0,051s][trace][os,container] Memory Limit is: Unlimited [0,051s][debug][os,container] container memory limit unlimited: -1, using host value [0,053s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,053s][trace][os,container] Memory Limit is: 9223372036854771712 [0,053s][trace][os,container] Memory Limit is: Unlimited [0,053s][debug][os,container] container memory limit unlimited: -1, using host value [0,053s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,053s][trace][os,container] Memory Limit is: 9223372036854771712 [0,053s][trace][os,container] Memory Limit is: Unlimited [0,053s][debug][os,container] container memory limit unlimited: -1, using host value [0,054s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,054s][trace][os,container] Memory Limit is: 9223372036854771712 [0,054s][trace][os,container] Memory Limit is: Unlimited [0,054s][debug][os,container] container memory limit unlimited: -1, using host value [0,054s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,054s][trace][os,container] Memory Limit is: 9223372036854771712 [0,054s][trace][os,container] Memory Limit is: Unlimited [0,054s][debug][os,container] container memory limit unlimited: -1, using host value [0,055s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,055s][trace][os,container] Memory Limit is: 9223372036854771712 [0,055s][trace][os,container] Memory Limit is: Unlimited [0,055s][debug][os,container] container memory limit unlimited: -1, using host value [0,055s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,055s][trace][os,container] Memory Limit is: 9223372036854771712 [0,055s][trace][os,container] Memory Limit is: Unlimited [0,055s][debug][os,container] container memory limit unlimited: -1, using host value [0,056s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,056s][trace][os,container] Memory Limit is: 9223372036854771712 [0,056s][trace][os,container] Memory Limit is: Unlimited [0,056s][debug][os,container] container memory limit unlimited: -1, using host value [0,056s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,056s][trace][os,container] Memory Limit is: 9223372036854771712 [0,056s][trace][os,container] Memory Limit is: Unlimited [0,056s][debug][os,container] container memory limit unlimited: -1, using host value [0,056s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,056s][trace][os,container] Memory Limit is: 9223372036854771712 [0,056s][trace][os,container] Memory Limit is: Unlimited [0,056s][debug][os,container] container memory limit unlimited: -1, using host value [0,056s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,056s][trace][os,container] Memory Limit is: 9223372036854771712 [0,056s][trace][os,container] Memory Limit is: Unlimited [0,056s][debug][os,container] container memory limit unlimited: -1, using host value openjdk version "11.0.1" 2018-10-16 [0,058s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes [0,058s][trace][os,container] Memory Limit is: 9223372036854771712 [0,058s][trace][os,container] Memory Limit is: Unlimited [0,058s][debug][os,container] container memory limit unlimited: -1, using host value OpenJDK Runtime Environment (build 11.0.1+13-Ubuntu-2ubuntu1) OpenJDK 64-Bit Server VM (build 11.0.1+13-Ubuntu-2ubuntu1, mixed mode, sharing) root@ubuntu-18-10:~# uname -a Linux ubuntu-18-10 4.18.0-10-generic #11-Ubuntu SMP Thu Oct 11 15:13:55 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
18-01-2019

So it looks like between kernel versions 4.15 and 4.18 this issue got introduced.
18-01-2019

Note that for affected systems path to memory.limit_in_bytes includes the 'run-<sha>.scope'. Unaffected systems seem to have that path to /sys/fs/cgroup/memory/user.slice/user-cg.slice/memory.limit_in_bytes: root@ubuntu-18-10:~# grep hierarchical_memory_limit /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.stat hierarchical_memory_limit 10485760 root@ubuntu-18-10:~# cat /sys/fs/cgroup/memory/user.slice/user-cg.slice/run-rdd6e130656124a71b50c8ebfe6740de1.scope/memory.limit_in_bytes 9223372036854771712 root@ubuntu-18-10:~# cat /sys/fs/cgroup/memory/user.slice/user-cg.slice/memory.limit_in_bytes 10485760
18-01-2019

Ubuntu 18.04 with kernel 4.15 doesn't seem to be affected. RHEL-8 beta, with kernel 4.18 is, though.
17-01-2019