Re:Go’s march to low-latency GC
by 102030485868 on Wednesday July 06, 2016 @11:24PM
(#12047317)
Unless you specifically tell the JVM otherwise using the -Xmx flag.
See: https://docs.oracle.com/cd/E13150_01/jrockit_jvm/jrockit/jrd...
If your machine actually does have gobs of free RAM, it therefore makes sense for Java to use all of it.
If your machine has gobs of free RAM you were planning on using for something else after your Java app started, well, that's something the JVM couldn't know. Some versions (on Windows?) monitor free memory and adjust down its own usage if you seem to be consuming the headroom, but on other platforms, you just have to tell Java it's got a limit and can't go beyond it.