0

According to IBM it is possible to turn off the jit compiler using Compiler.disable() and I have read on stackoverflow that it is not possible (only using command line arguments - How to check if the JIT compiler is off in Java). Which of the approaches is correct?

Community
  • 1
  • 1
Biscuit128
  • 5,218
  • 22
  • 89
  • 149

3 Answers3

1

Please notice that WebSphere Real Time is actually an IBM Java Virtual Machine different from the standard Oracle one available for download.

The correct approach depends on which VM you are actually using:

If you are using the standard VM, use command line arguments.

If you do use WebSphere, use Compiler.disable().

Marcelo
  • 4,580
  • 7
  • 29
  • 46
  • Sorry I am not using websphere, is it possible to change the arguments for turning the compiler off at run time? – Biscuit128 Feb 29 '12 at 10:46
  • @Ricki No way that I can think off. Why do you want to do it at runtime anyway? What's your use case? – Marcelo Feb 29 '12 at 11:30
0

For an IBM Jvm, it appears you can disable JIT altogether with -Xint

http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/topic/com.ibm.java.doc.diagnostics.60/diag/appendixes/cmdline/commands_jit.html

Jonathan S. Fisher
  • 8,189
  • 6
  • 46
  • 84
0

IBM JDKs (including WebSphere Real Time) support the java.lang.Compiler API, including the disable() and enable() calls. It's not something we generally recommend using, because it obviously interferes with the JIT compiler's heuristics used to identify what code should be compiled, but the facility is there and supported from Java 5 on (which is where the Compiler API was introduced).

Mark
  • 46
  • 2