I have a server with 72 GB memory running, it was use Java 7 with parallel GC and heap size in 25G. But after switch into Java 8, a particular task get much slower. The task basically read a file around 15GB in the memory, and update some relevant data in DB. It usually takes around one hour to finished the job, but after Java 8, it becomes 1.5 hours.
I tried:
So I am not sure where I can start to have a look, the java library to run the task is still compiled in Java 7 but I am not sure if this relevant? After switch to Java 7, the performance just came back.
Executive summary. For your convenience, I 've compared each Garbage Collector type to the default in Java 8 (Parallel GC). The results are clear: That default (Parallel GC) is the fastest.
Java 7 64-bit, you get Parallel GC (for both young and old generations) by default.
GC is slow, mostly because it needs to pause program execution to collect garbage.
Parallel/Throughput GC This is JVM's default collector in JDK 8. As the name suggests, it uses multiple threads to scan through the heap space and perform compaction. A drawback of this collector is that it pauses the application threads while performing minor or full GC.
To compare/find GC issue, it's better to enable GC logging:
and use GCViewer to parse/visualize GC log files. It will be useful if you gather GC log and attach it to question.
In theory (and practice), Java 8 is faster than Java 7. You mentioned that Java writes data to DB. It may be worth to analyze resource consumption of both, may be DB is root cause.
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