Regarding JIT compiler

Hi,
I would like to know what is a JIT compiler and how it works.My understanding of JIT compiler is that it is a compiler that takes in as input the bytecode and gives native code as output which is then interpretted by interpretter.I guess JIT compiler helps in speedig up the loops, but i dont know how.Could someone explain JIT and its features in detail or provide a useful link where i could get these details.
Thanks!!Have a Great Day!
vivek

Hi,
Thanks a lot guys. Well both the artciles were great.So to my understanding now......the portion of code which is bieng compiled by JIT need not be interpretted by Interprettor......am i right?so what JIT does is ...it converts the bytecode into series of intsructions that are understood by the underlying microporocessor......and the mp executes the instructions.......am i correct?
i have another doubt.......take a small pece of program which has no loop.........
int a =5;
int b= 6;
int c= a +b;
in this case if u use JIT compiler time taken will be
time taken by JIT to convert bytecode to machin code + time taken by CPU to execute the entire code.
in the caseof using interprettor :
well i guess interpretter executes each line at a time, so it converts the byte code into machine code one line at a time and CPU executes it.
so time taken is
time taken by Interprettor to convert each line of bytecode to machine code + time taken by CPU to execute each line of code.
SO I guess JIT compiler wud be faster.SO wudnt it be advantageous over inteprettor in all cases?Or does JIT compiler waste time in optimizing small pieces of code which does not reqiure optimization in which cases interpretter is quicker?
Thanks!
Vivek

Similar Messages

  • Investigation on JVM crash without core dump (by JIT compiler)

    Hi, All
    I posted "JVM crash without core dump due to CompilerThread1" couple months ago.
    http://forum.java.sun.com/thread.jspa?threadID=5253434
    I would like show what we found, and ask couple questions
    1) The reason of JVM crash is "CompilerThread0/1 wanted to allocate more native memory and eventually exceeded the limit of 32-bit Linux (on Redhat, the limit of VIRT is 3G)
    2) After we lower the heap size (to reduce process size) and added process size monitor (track process size every minute) and JIT compilation log (-XX:+PrintCompilation),
    We found sometimes JVM process jumped more than 800M when compiling one method. with the following log
    Total time for which application threads were stopped: 0.1997400 seconds
    5828 xxx.xxx.SomeClass::someMethod (1507 bytes)
    5828 COMPILE SKIPPED: out of nodes during split (not retryable)
    549002.449: [GC [PSYoungGen: 517897K->28390K(551296K)] 942855K->453348K(1229952K), 0.0726350 secs]
    if we saw "COMPILE SKIPPED: out of nodes during split (not retryable)", the process size of JVM (VIRT/RES) always jumped 800M~1000M, and sometimes the memory get reverted in 30mins to couple hours, and sometimes it lasted forever. (so before we have larger footprint, this jump will kill JVM, right now, if the jump lasts forever, any more allocation on top of it also can kill jvm (much rare))
    3) This is definitely a bug of JVM, because
    it only happened on server mode, not client mode
    it is random, that method can be compiled success on other JVM or next restart (we have 20 JVMs)
    the method is not that complicate, like 100 lines, (bigger method gets compiled success)
    this only happen on PROD environment, we can't reproduce it locally or QA (the method is always compiled success)
    It mostly like under some condition (maybe node space is not enough), to compile that method will trigger JVM trying to allocate much more native memory.
    4) We are going to disable this method by ".hotspot_compiler" to fix it, right now we are using lower footprint, JVM dies rarely.
    +To understand more about this, I have some questions about JIT compiling+
    I saw same method are compiled more than once from JIT log, like the method caused our problem, it only happens on 2nd time compilation.
    Is it that JIT compiler will recompile the method with deeper optimization level some time, and more optimization it uses, the more memory it requires?
    (like gcc has -O2 -O3)
    Thanks!
    Neo

    Today, one JVM crashed again, with
    {Heap before gc invocations=4188:
    PSYoungGen      total 540864K, used 487958K [0x8ba50000, 0xb1250000, 0xb1250000)
      eden space 467328K, 100% used [0x8ba50000,0xa82b0000,0xa82b0000)
      from space 73536K, 28% used [0xa82b0000,0xa96d5850,0xaca80000)
      to   space 71680K, 0% used [0xacc50000,0xacc50000,0xb1250000)
    ParOldGen       total 1024000K, used 493477K [0x4d250000, 0x8ba50000, 0x8ba50000)
      object space 1024000K, 48% used [0x4d250000,0x6b439610,0x8ba50000)
    PSPermGen       total 101760K, used 101240K [0x2d250000, 0x335b0000, 0x4d250000)
      object space 101760K, 99% used [0x2d250000,0x3352e1f8,0x335b0000)
    405290.711: [GC [PSYoungGen: 487958K->17397K(544192K)] 981435K->518248K(1568192K), 0.0769350 secs]
    Heap after gc invocations=4188:
    PSYoungGen total 544192K, used 17397K [0x8ba50000, 0xb1250000, 0xb1250000)
    eden space 472512K, 0% used [0x8ba50000,0x8ba50000,0xa87c0000)
    from space 71680K, 24% used [0xacc50000,0xadd4d480,0xb1250000)
    to space 70208K, 0% used [0xa87c0000,0xa87c0000,0xacc50000)
    ParOldGen total 1024000K, used 500851K [0x4d250000, 0x8ba50000, 0x8ba50000)
    object space 1024000K, 48% used [0x4d250000,0x6bb6cf70,0x8ba50000)
    PSPermGen total 101760K, used 101240K [0x2d250000, 0x335b0000, 0x4d250000)
    object space 101760K, 99% used [0x2d250000,0x3352e1f8,0x335b0000)
    Total time for which application threads were stopped: 0.0779620 seconds
    Exception in thread "CompilerThread1" java.lang.OutOfMemoryError: requested 4522768 bytes for Chunk::new. Out of swap space?

  • Need of a jit compiler

    hi,
    what i know is jit compiler is used to boostup the process of converting byte code into native machine code .then in the absence of jit who will do this process.
    and please also calrify
    will byte code be interpreted or complied into native code ?
    if jit compiler will compile the byte code into native code then why java is called interpreted language?

    hi,
    what i know is jit compiler is used to boostup the
    process of converting byte code into native machine
    code .then in the absence of jit who will do this
    process.What ever it is that is used instead.
    and please also calrify
    will byte code be interpreted or complied into native
    code ?Take a guess: why is it called compiler and not interpreter?
    if jit compiler will compile the byte code into
    native code then why java is called interpreted
    language?It isn't.

  • Bug in the JIT compiler?

    Hi All,
    I don't know if I have found a bug in the JIT compiler.
    uname -a : Linux kiloo-server2 2.6.26-2-amd64 #1 SMP Fri Mar 27 04:02:59 UTC 2009 x86_64 GNU/Linux
    java -version:
    java version "1.6.0_12";
    Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
    Java HotSpot(TM) 64-Bit Server VM (build 11.2-b01, mixed mode)
    all in our server module runs fine, until we try to rescale/transform an Image from a rss feed. after this a CompilerThread0 is started and never stops.
    it just keeps running at 100% on core0
    so right now we are running our server module with the -Xint option.. this is of course not an ideal solution.
    Before we moved the server module to linux, it was running on a windows machine (the same code), and there was no JIT compilerthreads problems.
    Is there anybody who has experienced anything like this, and is there a workaround to it?
    BR
    Kristian

    Kristian_Iversen wrote:
    Hi All,
    I don't know if I have found a bug in the JIT compiler.To start with you would need to reduce the code from your "server module" to a very small piece of code that demonstrates the problem.

  • JIT compiler and nested classes

    Q1. how does JIT compile on fly and improve the performance ?
    Q2. how is system.out.println(argument) implemented in java ? is it that system is a class in which out is a static nested class and println is a static method in out?

    Hello rishiluvsjava,
    Q1. How does JIT compile on fly and improve the performance?
    The following answer was taken from "The Java HotSpot Performance Engine Architecure: A White Paper About Sun's Second Generation Performance Technology" to view the full document go to:
    http://java.sun.com/products/hotspot/whitepaper.html
    Just-In-Time (JIT) compilers are essentially fast traditional compilers that translate the Java-technology bytecodes into native machine code on-the-fly. A JIT runs on the end-user's machine which actually executes the bytecodes, and compiles each method the first time it is executed.
    Q2. How is System.out.println(argument) implemented in java ? is it that system is a class in which out is a static nested class and println is a static method in out?
    From the Java docs:
    System is a public final class in the java.lang package. It has three fields:
    static PrintStream err    // The "standard" error output stream.
    static InputStream in    // The "standard" input stream.
    static PrintStream out  //The "standard" output stream.println is one of the methods in the java.io.PrintStream class.
    -Merwyn,
    Developer Technical Support,
    http://www.sun.com/developers/support.

  • JIT compiler "jitc" not found

    Hi,
    I've just installed JVM 1.4.2 for Unix Systems Services on z/OS 1.4 mainframe.
    When I issue the command java -version I get the following:
    # java -version
    Could not load dll : /usr/lpp/java/IBM/J1.4/bin/libjitc.so
    : EDC5157I An internal error has occurred.
    Warning: JIT compiler "jitc" not found. Will use interpreter.
    java version "1.4.2"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
    Classic VM (build 1.4.2, J2RE 1.4.2 IBM z/OS Persistent Reusable VM build cm142-
    20070329 (SR8) (JIT disabled))
    I have check for libjitc.so in the java directory and it is there. Java compiles and runs fine. Can anyone help?

    OS/400 interprets Java methods until reaching the threshold specified by the os400.jit.mmi.threshold Java system property. After reaching the threshold, OS/400 uses the JIT compiler to compile methods into native machine instructions.
    To use the Just-In-Time compiler, you need to set the compiler value to jitc (default it isn't). You can set the value by adding an environment variable or setting the java.compiler system property. Select one method from the list below to set the compiler value:
    * From a command line prompt on your iSeries server, add the environment variable by using the Add Environment Variable (ADDENVVAR) command. Then, run your Java program using the Run Java (RUNJVA) command or JAVA command. For example, use:
    ADDENVVAR ENVVAR (JAVA_COMPILER) VALUE(jitc)
    JAVA CLASS(Test)
    * Set the java.compiler system property on the iSeries command line. For example, enter JAVA CLASS(Test) PROP((java.compiler jitc))
    * Set the java.compiler system property on the Qshell Interpreter command line. For example, enter java -Djava.compiler=jitc Test
    Once you set this value, the JIT compiler optimizes all of the Java code before running it.

  • Difference between JIT compiler and Execution engine...

    where does bytecode get generated???is is in the JIT compiler or in the execution engine???What actually is the process happening inside JVM???can anybody help me in knowing this???

    where does bytecode get generated?Bytecode is the output of javac, the j2se sdk java source compiler.
    is it in the JIT compiler or in the execution engine?No, and No.
    What actually is the process happening inside JVM?The bytecode of the classes to be used
    is loaded and verified
    For an application the main() method of the primary class is launched.
    can anybody help me in knowing this?Unknown.
    We can tell you the answers to the questions you seem to be asking.
    It would help if you could be a bit more specific.

  • Jit compiler "symcjit" not found

    while installing the database 8i enterprise edition on p4 , win 2000 the net8 configuration assistant succeeded but the oracle database configuration assistant failed.
    note that i can still continuing the installation ... but the details on this error in the detail section note " warning jit compiler "symcjit not foubd.will use interpreter.
    folderstarterdb is an invalid command line argument.
    any solution please?

    symcjit.dll is a library for the Just In Time compiler and this was an issue that made people think there was a but with the Pentium IV CPU. This was due to a but with the jit compiler included with the Oracle install media.
    The problem was specifically when the install process took place on P-IV platfoms, the OUI graphical interface didn't appear. The workaround to solve this issue was to create a stage area where the symcjit.dll file was removed. Afterwards, the install ran smoothly. This should not be an issue during the regular oracle operation since the binaries included the correct symcjit.dll file, so it was not necessary to do anything else. If you removed not only the symcjit.dll file from the install media, but also from the Oracle Home then you can expect this error to show up.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • Code generated by JIT compiler

    Hi,
    I'm doing some research about Java and C performance on different platforms. My question: is it possible to access the code that is generated by JIT compiler. Without knowing what exactly JIT compiler does, only the statistical analysis (performance measurements) can be made...
    Thank you in advance!
    Vytautas Dusevicius,
    M.Sc student in Aalborg University, Denmark

    is it possible to access the code that is generated by JIT compiler.Considering that there is no "JIT compiler" any more, no. HotSpot generates fragments of native code at the basic block (or even finer) level within routines. I don't know if there's a dumper that can dump out the code sequences chosen.
    Oh, you can try downloading the SCSL (Sun Community Source License) JDK sources, and reading the HotSpot source files..

  • Space limit for JIT-compiled code?

    I was just wondering if there is an upper limit on the amount of space that can be occupied by JIT-compiled native code.

    Yes, there is an upper limit.
    To anticipate your next question ;-), the upper limit is controlled by
    -Xmaxjitcodesize<size>
    Search for it on this page:
    http://blogs.sun.com/roller/resources/watt/jvm-options-list.html
    And, if you have the source code to look at [note 1], look for:
    define_pd_global(intx, InitialCodeCacheSize,         160*K);
    ....hotspot/src/share/vm/runtime/globals_core.hppNote 1:
    https://j2se.dev.java.net/

  • Adaptive Optimization Vs JIT Compilation

    Hello All
    In the below link it is stated that Adaptive Optimization improves the preformance by compiling only frequently used methods.
    Now even in JIT compilation I believe there is threshold that is set , like only if a method has been invoked 400 times the JIT compilations will happen. So my understanding is even in JIT compilation only frequently used methods are compiled.
    But I know I am certainly missing something here as the link is from Oracle.
    Could some one please clarify ? Any insight is higly appreciated.
    http://www.oracle.com/technetwork/java/whitepaper-135217.html#hotspot
    Thanks

    Thanks for the reply but I think HotSpot is only the name of the JVM that has the new technology built into it.Sun have been calling it a technology for ten years, including one of the links you cited.
    The new technology should be the AdaptiveOptimization.Try telling Sun. It's not your decision.
    My question is what is the difference between AdaptiveOptimization and JIT Compilation.Considering you just made up the former name, it's really up to you to tell us.
    I googles a lot but did not get many resources and also were not clear.I find that very difficult to believe.
    For some reason I thought this -XX:CompileThreshold was also available on VMs that had JIT compilersVMs such as what? The whole -XX thing is Sun's, now Oracle's, and they stopped shipping JITs ten years ago, as I already said above.

  • How to configure JIT compiler

    i installed J2SE 1.4.1 in my machine.I want to know JIT is installed along with that.If so how to change the default compiler(hotspot) in to JIT Compiler.
    Which compiler gives faster performance.Whether is it Hotspot and JIT.

    No, JIT is not installed.
    You can check by calling System.getProperty("java.compiler"), which returns null.

  • JIT compiler

    Hi,
    As I understand the Just-in-time compiler optimizes common bytecode sequences rather than single bytecodes at a time. Would anyone know where I could obtain details of these bytecode sequences or even information relevant to JIT's optimization?
    Thanks
    Peter

    Hi,
    Does this have anything to do with Java Hot spotted
    VM? if there is then will you let me know where I can
    obtain more information on this.As per myunderstanding the HotSpot name has come from there ie hotspotting the sequences(loops or function being called frequently)
    This is because I need to these sequences so that I
    can benchmark these sequences and create a benchmark
    system for Java program. At the moment I am working on
    Performace Characteristion for Java programs... more
    info
    http://www.dcs.warwick.ac.uk/~hpsg/html/htdocs/public/p
    ce.html
    These sequences will be the loop or function as per my knowledge,I dont have more documents to justify this but I believe only the loop or function will be hotspotted.
    Anyway u refer to the first reference given by me,I think this all can be concluded from there.
    Regards
    Vicky

  • How to enable HotSpot or JIT compiler with java 1.4.0-rc

    Sorry but I can't enable the JIT or Hotspot tecnology in java 1.4.0-rc? they are just installed in this JRE version or I have to do any operation to install these tevnology?
    I can't also install the HotSpot server with this version of JRE! it's right? The installer ask me an older version to install this application!
    can you help me?

    Hi,
    The Hotspot VM is now the only and default VM in 1.4 (Merlin).
    Previously this was a -hotspot option but now is renamed -client (the default).
    If you require the server VM then use -server after downloading the SDK. The Hotspot v2 server is for 1.3 and 1.2.2 only.
    Regards,
    Matt
    Java Developer Technical Support
    Sun Microsystems

  • 9.0.3 "Bug" report regarding paths, compiling, and running

    I don't know if this is a bug or some kind of strange feature but it caused me to lose about an hour and a half of work before I figured out what was going on.
    BACKGROUND:
    I have a project UVDebug.jpr. It's full pathname is :
    C:\My Documents\OracleJDev\Visia\UVDebug\UVDebug.jpr
    Now this project has one file in it: UVDebug.java, however, this java source code file doesn't live in a subfolder of the folder containing the project. Shouldn't be a problem. It's path is
    C:\My Documents\OracleJDev\Visia\VisiaProject\src\debug\visia\UVDebug.java
    As far as I know now, the files you add to a project can live anywhere.
    The output path (where the class files get created/saved) IS a subfolder of the project folder. It's path is
    C:\My Documents\OracleJDev\Visia\UVDebug\classes
    THIS WORKS:
    If I FIRST click the rebuild project button, the class gets created in the correct folder:
    C:\My Documents\OracleJDev\Visia\UVDebug\classes\debug\visia\UVDebug.class
    If I then click the red bug button to run the project in debug mode, it works fine.
    THIS DOES NOT WORK, BUT IT SHOULD:
    If I DO NOT first click the rebuild project button, but instead, just go directly to clicking the red bug button to run it, then it is supposed to compile the source into a class and then run the class. However, the class does not get created and when it goes to run, it throws a class not found exception.
    If the source code UVDebug.java DOES live in a sub folder of the folder containing the project, then clicking the red bug button WILL compile it and run it. I.e. the source code lives in
    C:\My Documents\OracleJDev\Visia\UVDebug instead of
    C:\My Documents\OracleJDev\Visia\VisiaProject\src\debug\visia
    However if the source code does not live in a subfolder of the folder containing the project, you must first compile the project as a separate step before you click the red bug button to run it.
    I don't know why the situation that didn't work didn't work -- it should have worked as far as I understand. Am I wrong here? Do all source code files and output class files have to be in subfolders of the project if you want to click only red bug instead of rebuild all and red bug?
    Mark Hayworth
    Cincinnati Ohio

    I really don't know exactly what happened as what you have described should all work.
    Try those following steps:
    - Completely clean out your output path
    including any .cdi files you might have
    at the root of your output path
    - Go back in jdev and make sure the runner
    option is to make the application before
    running
    - Run (and/or) debug and it should work, does it?
    Michel

Maybe you are looking for

  • How do I move Adobe Acrobat X to a new workstation.

    I need to move Adobe Acrobat X to a new workstation. How do i reinstall Adobe Acrobat X to this new station since Adobe Acrobat XI is now out? I have the serial number for Acrobat X. Do I install Acrobat XI and use Acrobat X license?

  • Open e-mail attachments in BB 8703e

    I am getting my e-mails from Outlook 2003 (Exchange Server) using the BB Desktop Redirector : that way I get everything that reaches my Inbox at the office.  Even though my 8703e has the application "BB Attachment Service 4.2", I can not open e-mail

  • Strange installation error!Thread: Exception in thread "main" java.lang.Uns

    Hello Guys, I did it in the morning also, but on a second machine i am getting this error: I have installed centOS 5 and changed redhat-release file to show redhat-4 After installaing all the packages and setting all as per documentation when i try t

  • Timecode via sdi from timeline

    I am a bit frudtrated seeing that i can not get timecode from timeline out via sdi to my pdw-hd1500. In fcp7 you can crash record straight to xdcam disc and the timecode comes right through the sdi. anyone have any thoughts? Thanks!

  • Firefox 3.6.1 keeps forgetting my iGoogle settings.

    I do not delete any of my Google cookies and Internet Explorer 8 does NOT have this problem. I use Windows 7. Please help!