In earlier versions of Java 8 (before update version 192), the JVM has no knowledgeof any limits that the container will enforce: when it inspects the environment to find out how much memory is available so it can calculate its default heap size, it will see all the memory on the machine (instead of,as we would prefer, the amount of memory the Docker container is allowed touse)
docker run -m 512 ....
https://www.upnxtblog.com/index.php/2019/03/14/how-to-set-memory-limit-for-your-java-containers/
https://stackoverflow.com/questions/64703776/how-to-set-memory-limit-for-java-11-inside-docker/64705449#64705449
https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits
-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap : permet de ne limiter la taille de la JVM qu'à ce que peux supporter le conteneur.
-XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics : log des informations sur l'occupation des espaces mémoires propres à la JVM.
Aucun commentaire:
Enregistrer un commentaire
to criticize, to improve