DEV Community

Discussion on: Should I run JVM applications inside a container?

Collapse
 
elmuerte profile image
Michiel Hendriks

The Java "container" support was a fix for the Runtime to return the effective resource (RAM/CPU) sizes when they were set via the Linux cgroups feature. Originally it returned the system values. This would have some side nasty side effects if you did not also tune the JVM parameters. So it's not actually container support, but rather a fix for system resource limits.

Which means that if, for example, you mange your Java application via Linux' systemd you can also limit the max memory and CPU via the systemd specification for that service, and the Java instance will properly pick it up.

I don't get picture #6. It makes it seem like you can only run a single Java process per system. Java programs are much more self contained than for example Perl/Python/NodeJS/... You can easily install multiple different Java versions on the system system running various Java programs with different dependencies. They won't bite each other.