Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is JDK7 safe to use now?

Tags:

java

java-7

I have recently learned that there are bugs in JDK7 for hotspot compiler optimization. See this thread.

I don't quite understand the details of these bugs, but they seem to be related to loop optimization. Since I'm going to run some large-scale program in the -server mode (which of course contains a lot of loops), I wonder whether it would be safe to use JDK7 or not? Thank you.

like image 441
took Avatar asked Aug 16 '11 02:08

took


1 Answers

The same bug exists in JDK 6, but since the default optimization are different, it only comes into play when aggressive optimization flags are used.

To disable this optimization for JDK 7 use the -XX:-UseLoopPredicate flag and you will be safe across any version of JDK 7.

like image 121
GBa Avatar answered Oct 07 '22 23:10

GBa