elgalu / docker-selenium

[NOT MAINTAINED] Please use <https://github.com/SeleniumHQ/docker-selenium>
https://github.com/SeleniumHQ/docker-selenium
Other
1.42k stars 333 forks source link

Java Xmx is not accurate under docker container #357

Closed lcharlois-neotys closed 4 years ago

lcharlois-neotys commented 4 years ago

The sh script used to set java Xmx parameter in JAVA_OPTS doesn't take into account the container memory limitation. The script set a Xmx value based on the docker engine memory.

Running the container with ot without memory limit give the same result.

$ docker run -it -e MEM_JAVA_PERCENT=100  elgalu/selenium /usr/bin/java-dynamic-memory-opts.sh
-Xmx32843292k
$ docker run -it -e MEM_JAVA_PERCENT=100 -m 4g  elgalu/selenium /usr/bin/java-dynamic-memory-opts.sh
-Xmx32843292k

The expected value for the second test is : -Xmx4294967k

Operating System

Image version

Docker version

Docker-Compose

(if using docker-compose)