Docker memory limit causes SLUB unable to allocate with large page cache Docker memory limit causes SLUB unable to allocate with large page cache docker docker

Docker memory limit causes SLUB unable to allocate with large page cache


java 10.0.1 2018-04-17

You should try with a more recent version of java 10 (or 11 or...)

I mentioned in "Docker support in Java 8 — finally!" last May (2019), that new evolutions from Java 10, backported in Java 8, means Docker will report more accurately the memory used.

This article from may 2018 reports:

Succes! Without providing any flags Java 10 (10u46 -- Nightly) correctly detected Dockers memory limits.


The OP David confirms in the comments:

The docker - jvm integration is a big improvement in Java 10.
It is really to do with setting sane XMS and the number of processors. These now respect the docker container limits rather than picking up the host instance values (you can turn this feature off using -XX:-UseContainerSupport depending on your use case).

I have not found it helpful in dealing with the page cache though.
The best solution I have found is to disable the docker memory limit, after the container is created if need be.
This is definitely a hack - user beware.