jvm-arguments
what’s the difference between ParallelGC and ParallelOldGC?
Take a look at the HotSpot VM Options: -XX:+UseParallelGC = Use parallel garbage collection for scavenges. (Introduced in 1.4.1). -XX:+UseParallelOldGC = Use parallel garbage collection for the full collections. Enabling this option automatically sets -XX:+UseParallelGC. (Introduced in 5.0 update 6.) where Scavenges = Young generation GC.
Java 8 reserves minimum 1G for Metaspace despite (Max)MetaspaceSize
The reason why Java reserves 1G for Classes hides in the way how it manages compressed class pointers. The long answer: read this doc https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/considerations.html The short answer: setup the correct size in ‘CompressedClassSpaceSize’ property -XX:CompressedClassSpaceSize=300m
Can I force the JVM to natively compile a given method?
The only way I know of is the -Xcomp flag, but that is not generally advisable to use. It forces immediate JIT compilation of ALL classes and methods first time they are run. The downside is that you will see a performance decrease on initial startup (due to increased JIT activity). The other major limitation … Read more
JVM performance tuning for large applications
Foreword Background Been at a Java shop. Spent entire months dedicated to running performance tests on distributed systems, the main apps being in Java. Some of which implying products developed and sold by Sun themselves (then Oracle). I will go over the lessons I learned, some history about the JVM, some talks about the internals, … Read more
Cassandra and Java 9 – ThreadPriorityPolicy=42 is outside the allowed range
I had exactly the same issue: Can’t start Cassandra (Single-Node Cluster on CentOS7) If it is an option for you, using Java 8, instead of 9, is the simplest way to solve the issue.
Java VM tuning – Xbatch and -Xcomp
Generally speaking, it’s always preferable to let HotSpot compiler tune itself. Even using Server VM (-server) is default for 64bits and some ‘server-class’ machines. -Xbatch was intended mostly for debugging as described in Steve Goldman’s blog you pointed: So the -Xbatch switch is not a particularly useful switch even in the pre-mustang days. It is … Read more
How do I add default JVM arguments with Gradle
From the top of my head I can think of 2 options: Option1: Do what @Ethan said, it’ll likely work: package placeholder; //your imports public class Application{ static { System.getProperties().set(“javafx.embed.singleThread”, “true”); } // your code public static void main(String… args){ //your code } } Option 2: Use the application plugin + default jvm values build.gradle: … Read more
What is the largest possible heap size with a 64-bit JVM?
If you want to use 32-bit references, your heap is limited to 32 GB. However, if you are willing to use 64-bit references, the size is likely to be limited by your OS, just as it is with 32-bit JVM. e.g. on Windows 32-bit this is 1.2 to 1.5 GB. Note: you will want your … Read more
Multiple directories in -Djava.library.path
On Linux, use colon : as separator (as you will do with the classpath option) as in: -Djava.library.path=/opt/hdf-java/build/bin:/opt/opencv-2.4.10/build/lib