Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
None
Description
Chris Hyzer 10:36 PM
Is there a way for the container to know how much memory it has and some logic will allocate X-500m (or whatever the operating system etc needs) to the JVM? Im thinking a "free" system call and parse output to see total memory and then dynamically set the memory in the appropriate tomcat script? I think it would be easier for a deployer to size the container and not worry about also changing the dockerfile in the right spot... maybe im the only one who tripped on this... obviously we could have a dockerfile override so people can tune the default...
Today
----new messages
Jeffrey F Williams 9:11 AM
I haven't ran into it myself, but I think others have if I've read you correctly: https://developers.redhat.com/blog/2017/03/14/java-inside-docker/It also looks like Java 10 has made some inroads in terms of container awareness: https://medium.com/@jnsrikanth/docker-support-in-java-10-fbff28a31827
!https://slack-imgs.com/?c=1&o1=wi32.he32.si&url=https%3A%2F%2Fdevelopers.redhat.com%2Fblog%2Fwp-content%2Fthemes%2Frhd-frontend-blog-theme%2Fdist%2Ffavicon%2Fipad-retina.png|width=16,height=16!Red Hat Developer
Java inside docker: What you must know to not FAIL - Red Hat Developer
Many developers are (or should be) aware that Java processes running inside Linux containers (docker, rkt, runC, lxcfs, etc) don’t behave as expected when we let the JVM ergonomics set the default values for the garbage collector, heap size, and runtime compiler. When we execute a Java application without any tuning parameter like “java -jar mypplication-fat.jar”, the JVM will adjust by …
Mar 14th, 2017
!https://slack-imgs.com/?c=1&o1=wi32.he32.si&url=https%3A%2F%2Fcdn-images-1.medium.com%2Ffit%2Fc%2F152%2F152%2F1*8I-HPL0bfoIzGied-dzOvA.png|width=16,height=16!Medium
Docker Support in Java 10
Java on Docker should no longer suck!
Reading time
5 min read
Apr 9th, 2018(58 kB)
https://miro.medium.com/max/1200/1*3GhcbqTONq7H-NVqPgjF8A.png
9:15 AM
The RH Article talks about doing it in Java 8 using a specific docker image that has a script that does it.