13

我有一个每天运行的 JAVA 进程,需要大约 1,000 或 2,000 次点击才能完全被 JIT 优化。我想做的是保存 JIT 信息,以便第二天它可以在优化状态下启动。看起来这应该是可能的,但我还没有找到任何方法来做到这一点。

4

3 回答 3

3

您可以使用 JET 或 GCJ 之类的提前编译器,但我认为没有任何标准方法可以保存 JIT 表单。请记住,这会将您的程序与您正在运行的体系结构联系起来,但听起来您已经意识到并接受了这一点。

于 2010-02-01T17:25:35.607 回答
2

One option is to control the number of invocations needed for a method to be considered eligible for JIT compile.

-XX:CompileThreshold (default 10000).

You could play around various values to tune up with your application.

Please note that setting this to ZERO is NOT recommended.

于 2012-07-26T20:19:22.617 回答
0

你能保持你的应用程序运行吗?如果您只是让应用程序休眠到第二天而不是关闭,会发生什么?然后,您将节省启动 JVM 的时间以及可能跳过 jitting 阶段。

于 2010-02-01T17:41:58.880 回答