As of raising this question, Docker looks to be new enough to not have answers to this question on the net. The only place I found is this article in which the author is saying it is hard, and that's it.
Set Maximum Memory Access To limit the maximum amount of memory usage for a container, add the --memory option to the docker run command. Alternatively, you can use the shortcut -m . Within the command, specify how much memory you want to dedicate to that specific container.
The short answer is that you use these java command-line parameters to help control the RAM use of application: Use -Xmx to specify the maximum heap size. Use -Xms to specify the initial Java heap size. Use -Xss to set the Java thread stack size.
Note that in a docker-compose.yml
file - you'll need to leave out the double-quotes:
environment: - JVM_OPTS=-Xmx12g -Xms12g -XX:MaxPermSize=1024m
or
environment: - CATALINA_OPTS=-Xmx12g -Xms12g -XX:MaxPermSize=1024m
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With