为特定方法/类禁用 Java JIT? [英] Disable Java JIT for a specific method/class?

查看:20
本文介绍了为特定方法/类禁用 Java JIT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 Java 应用程序中遇到了 JIT 破坏代码的问题.如果我禁用 JIT,一切正常,但运行速度会慢 10-20 倍.

I'm having an issue in my Java application where the JIT breaks the code. If I disable the JIT, everything works fine, but runs 10-20x slower.

有什么方法可以禁用特定方法或类的 JIT?

Is there any way to disable the JIT for a specific method or class?

我正在使用 Ubuntu 10.10,得到相同的结果:

I'm using Ubuntu 10.10, getting the same results both with:

OpenJDK Runtime Environment (IcedTea6 1.9) (6b20-1.9-0ubuntu1)
OpenJDK 64-Bit Server VM (build 17.0-b16, mixed mode)

和:

Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

推荐答案

以下选项适用于我的 JVM,以排除特定方法:

The following option works on my JVMs, to exclude a specific method:

-X:CompileCommand=exclude,the/package/and/Class,methodName

这篇关于为特定方法/类禁用 Java JIT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆