简体   繁体   English

现在使用JDK7安全吗?

[英]Is JDK7 safe to use now?

I have recently learned that there are bugs in JDK7 for hotspot compiler optimization.最近得知JDK7中存在热点编译器优化的bug。 See this thread .看到这个线程

I don't quite understand the details of these bugs, but they seem to be related to loop optimization.我不太了解这些bug的细节,但它们似乎与循环优化有关。 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?由于我要在-server模式下运行一些大型程序(当然其中包含很多循环),我想知道使用JDK7是否安全? Thank you.谢谢你。

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. JDK 6 中存在相同的错误,但由于默认优化不同,因此只有在使用积极优化标志时才会发挥作用。

To disable this optimization for JDK 7 use the -XX:-UseLoopPredicate flag and you will be safe across any version of JDK 7.要为 JDK 7 禁用此优化,请使用 -XX:-UseLoopPredicate 标志,这样您就可以安全地使用任何版本的 JDK 7。

You should start testing your code with JDK7 now.您现在应该开始使用 JDK7 测试您的代码。

As to whether you want to put it into production, it is probably always safe to wait a while.至于是否要投入生产,等待一段时间可能总是安全的。 That does not just apply to the JDK, but to any major upgrade to any major piece of software.这不仅适用于 JDK,也适用于任何主要软件的任何重大升级。 Let them do their update1 and update2, and wait what Apache and others have to say for it.让他们做他们的 update1 和 update2,然后等待 Apache 和其他人要说的话。 You do not need to be in a hurry, right?你不必着急,对吧? JDK6 works... JDK6 工作...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM