Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JVM Memory Allocation In Docker (LXC) Container

Tags:

java

docker

jvm

We've dockerized a JVM (Scala) application, Java 1.7, and are trying to decide how to allocate memory. We have a single application running in the docker container. If the docker container is allocated 4GB of RAM, should we allocate 4GB (or maybe a little less just to be safe) to the JVM?

As I understand it, there aren't other processes running inside the docker container besides what's called from the entry point, so we shouldn't need to worry about non-JVM memory usage - is that true, or an over simplification? Are there any other questions we should be asking?

EDIT We're using Mesos / Marathon to deploy the docker images - I believe it does set cgroup limits on memory (at least, it gives the impression that it does) but I could definitely be wrong.

like image 731
Patrick White Avatar asked Dec 24 '14 01:12

Patrick White


Video Answer


1 Answers

I have same scenario, and i use 90% of reserved memory to jvm, and work very well

like image 147
Clayton SIlva Avatar answered Nov 15 '22 01:11

Clayton SIlva