jitwatch | Log analyser / visualiser for Java HotSpot JIT compiler

 by   AdoptOpenJDK Java Version: 1.4.7 License: Non-SPDX

kandi X-RAY | jitwatch Summary

kandi X-RAY | jitwatch Summary

jitwatch is a Java library typically used in User Interface, JavaFX applications. jitwatch has no vulnerabilities, it has build file available and it has medium support. However jitwatch has 37 bugs and it has a Non-SPDX License. You can download it from GitHub.

Log analyser and visualiser for the HotSpot JIT compiler. For instructions and screenshots see the wiki The JITWatch user interface is built using JavaFX which is downloaded as a maven dependency for JDK11+. For pre-JDK11 you will need to use a Java runtime that includes JavaFX. maven mvn clean compile test exec:java. gradle gradlew clean build run. Build an example HotSpot log # Build the code and then run ./makeDemoLogFile.sh.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              jitwatch has a medium active ecosystem.
              It has 2817 star(s) with 396 fork(s). There are 153 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 13 open issues and 239 have been closed. On average issues are closed in 997 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of jitwatch is 1.4.7

            kandi-Quality Quality

              OutlinedDot
              jitwatch has 37 bugs (0 blocker, 5 critical, 20 major, 12 minor) and 1487 code smells.

            kandi-Security Security

              jitwatch has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              jitwatch code analysis shows 0 unresolved vulnerabilities.
              There are 43 security hotspots that need review.

            kandi-License License

              jitwatch has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              jitwatch releases are available to install and integrate.
              Build file is available. You can build the component from source.
              jitwatch saves you 75801 person hours of effort in developing the same functionality from scratch.
              It has 84320 lines of code, 7462 functions and 343 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed jitwatch and discovered the below as its top functions. This is intended to give you an instant insight into jitwatch implemented functionality, and help decide if they suit your requirements.
            • Parses an assembly
            • Returns a string representation of an instruction
            • Format the operands
            • Convert an address string into a long value
            • Starts the parser
            • Redraw the labels
            • Redraw the current selection
            • Redraw the graph
            • Build the HBox UI
            • Dialog with text input
            • Returns a string containing the bytecode report
            • Build a table from a list of results
            • Returns a regular expression matching the source method signature
            • Main method for testing
            • Decodes a parse method
            • Setup the checkboxes
            • Parses an assembly instruction
            • Build the HBoxOptions
            • Returns a string representation of the method signature
            • Build table view from Observable
            • Build the box for the tiered compilation
            • Build table view
            • Setup the panel
            • Build table from list of columns
            • Called when a stage is closed
            • Build the hBoxOn
            Get all kandi verified functions for this library.

            jitwatch Key Features

            No Key Features are available at this moment for jitwatch.

            jitwatch Examples and Code Snippets

            No Code Snippets are available at this moment for jitwatch.

            Community Discussions

            QUESTION

            JIT recompiles to do fast Throw after more iterations if stacktrace is of even length
            Asked 2020-Mar-27 at 01:14

            The following code,

            ...

            ANSWER

            Answered 2020-Mar-27 at 01:14

            This effect is a result of tricky tiered compilation and inlining policy.

            Let me explain on the simplified example:

            Source https://stackoverflow.com/questions/60851417

            QUESTION

            unexplained 10%+ performance boost from simply adding a method argument (slimmer jit code)
            Asked 2019-Dec-21 at 03:10

            (note: proper answer must go beyond reproduction).

            After millions of invocations, quicksort1 is definitely faster than quicksort2, which have identical code aside from this 1 extra arg.

            The code is at the end of the post. Spoiler: I also found the jit code is fatter by 224 bytes even if it should be actually simpler (like the byte code size tells; see very last update below).

            Even after trying to factor out this effect with some microbenchmark harness (JMH), the performance difference is still there.

            I'm asking: WHY is there a such a difference in native code generated and what is it doing?

            By adding an argument to a method, it makes it faster...! I know about gc/jit/warmup/etc effects. You can run code as-is, or with larger/smaller iteration counts. Actually, you should even comment out one then the other perf test and run each in distinct jvm instance just to prove it's not an interference between each other.

            The bytecode doesn't show much difference, aside the obvious getstatic for sleft/sright but also a strange 'iload 4' instead of "iload_3" (and istore 4/istore_3)

            What the heck is going on? Is the iload_3/istore_3 really slower than iload 4/istore 4? And that much slower that even the added getstatic call is still not making it slower? I can guess that static fields are unused so the jit might just skip it.

            Anyway, there is no ambiguity on my side as it is always reproducable, and I'm looking for the explanation as to why the javac/jit did what they did, and why the performance is affected so much. These are identical recursive algo with same data, same memory churn, etc... I couldn't make an more isolated change if I wanted to, to show a significant replicable runtime difference.

            Env:

            ...

            ANSWER

            Answered 2019-Nov-24 at 18:29

            Reproduction and Analysis

            I was able to reproduce your results. Machine data:

            Source https://stackoverflow.com/questions/49754232

            QUESTION

            why this java code can not use escape analysis?
            Asked 2019-Nov-04 at 17:14

            my code is here =>

            ...

            ANSWER

            Answered 2019-Nov-04 at 17:14

            Escape Analysis in HotSpot C2 compiler is rather simple. It never attempted to detect all possible objects that do not escape the compilation scope. In particular, it does not currently handle a multi-level reference tree.

            In your example, a reference to a newly allocated Point is assigned to an object field: PointHolder.point. JIT treats this assignment as an escape of Point object and thus does not eliminate the allocation.

            One particular exception is boxing-unboxing: HotSpot handles boxing-unboxing methods specially. E.g. it would be still able to eliminate allocation of Integer object when it is assigned to an IntegerHolder field.

            This problem is not something unsolvable though - it's rather a missed optimization opportunity. Graal JIT is better in this sence - in the given example it does eliminate both Point and PointHolder allocations.

            Source https://stackoverflow.com/questions/58678340

            QUESTION

            JIT - micro optimization - if statement elimination
            Asked 2018-Nov-13 at 10:47

            Let's assume we have the following code:

            ...

            ANSWER

            Answered 2018-Nov-13 at 10:47
            1. Does the JIT compiler have a way to detect that the if will always be true after a certain point

            Yes, if the field is static final, and its holder class has been initialized by the time JIT compiler kicks in. Apparently this is not applicable in your case, since Config.initialized cannot be made static final.

            1. is there anything I could do to support that?

            java.lang.invoke.MutableCallSite to the rescue.

            This class is designed specifically for doing things you ask. Its setTarget method supports rebinding the call site in runtime. Under the hood it causes deoptimization of currently compiled method with the possibility to recompile it later with new target.

            A MethodHandle for calling the MutableCallSite target can be obtained with dynamicInvoker method. Note that MethodHandle should be static final in order to allow inlining.

            1. if the above method got inlined somewhere that all those methods would be recompiled

            Yes.

            Here is a benchmark demonstrating that mutableCallSite method is as fast as alwaysFalse at the beginning, and also as fast as alwaysTrue after switching the toggle. I also included a static field toggle for comparison as @Holger suggested.

            Source https://stackoverflow.com/questions/53271900

            QUESTION

            Why getSum does not get inlined by hotspot jvm?
            Asked 2018-Mar-12 at 11:18

            Here's the example I tried to reproduce from Java Performance: The Definitive Guide, Page 97 on the topic of Escape Analysis. This is probably what should happen:

            1. getSum() must get hot enough and with appropriate JVM parameters it must be inlined into the caller main().
            2. As both list and sum variables do not escape from main() method they could be marked as NoEscape hence JVM could use stack-allocation for them instead of heap-allocation.

            But I ran it through jitwatch and the result showed that getSum() compiles into native-assembly and doesn't get inlined into main(). Not to mention consequently stack-allocation didn't happen either.

            What am I doing wrong in here ? (I have put the whole code and hotspot log here.)

            Here's the code:

            ...

            ANSWER

            Answered 2018-Mar-12 at 11:18

            In order to know why something is inlined or not, you can look in the compilation log for the inline_success and inline_fail tags.

            However to even get something inlined, the caller would have to be compiled, in your case you want an inline in the main method so the only way this is going to happen is on-stack replacement (OSR). Looking at your log, you can see a few OSR compilations but none of the main method: there is simply not enough work in your main method.

            You can fix that by increasing the number of iteration of your for loop. By increasing it to 100_000, I got a first OSR compilation.

            For such a small example is looked at -XX:+PrintCompilation -XX:+PrintInlining rather than the whole LogCompilation output and I saw:

            Source https://stackoverflow.com/questions/49217707

            QUESTION

            Chronicle Queue StoreTailer.next() creating huge amount of garbage
            Asked 2017-Sep-08 at 21:10

            I'm bench-marking Chronicle queue for one of our use cases and noticed that readDocument() API of the ExcerptTailer creates too much garbage! JFR shows that the process spends around 66% of the time in the stack below.

            What version of Chronicle Queue am I using ?

            net.openhft:chronicle-queue:4.5.9

            How am I creating the queue ?

            ...

            ANSWER

            Answered 2017-Sep-08 at 21:10

            This only happens when busy polling and there is no messages. You could add a dummy message to prevent this. A workaround was added to later versions.

            Source https://stackoverflow.com/questions/46105183

            QUESTION

            JITWatch assembly code generation
            Asked 2017-Mar-29 at 10:31

            I am trying to use JITWatch to see how assembler code corresponds to original Java source code. However, JITWatch does not seem to see my assembly code and prints the following message:

            Assembly not found. Was -XX:+PrintAssembly option used?

            I am using Oracle's JRE 1.8.0_121 on Windows 10 Home. I've added dissembly dll's to my JRE. The dll's were downloaded from FCML project. I can confirm that assembly is generated when I run program with java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly test.Test options.

            I've configured JITWatch paths so that *.java and *.class files are visible to it. For JITWatch analysis I run my Java program with java -XX:+UnlockDiagnosticVMOptions -XX:+TraceClassLoading -XX:+LogCompilation -XX:+PrintAssembly test.Test and open the generated .log file with JITWatch. It can see the Java code and bytecode, but not the assembly. I suspect the problem is caused by the fact that assembly is printed to standard output (to the console) and not to log file. Is there an option I am missing?

            ...

            ANSWER

            Answered 2017-Mar-29 at 10:31

            It was a bug that occured when JITWatch was used together with FCML dissassembler. Thanks to prompt reaction by program developer it is fixed now.

            Source https://stackoverflow.com/questions/43066522

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install jitwatch

            You can download it from GitHub.
            You can use jitwatch like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the jitwatch component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Reuse Pre-built Kits with jitwatch

            Consider Popular Java Libraries

            CS-Notes

            by CyC2018

            JavaGuide

            by Snailclimb

            LeetCodeAnimation

            by MisterBooo

            spring-boot

            by spring-projects

            Try Top Libraries by AdoptOpenJDK

            homebrew-openjdk

            by AdoptOpenJDKRuby

            openjdk-build

            by AdoptOpenJDKShell

            openjdk-jdk8u

            by AdoptOpenJDKJava

            jdk9-jigsaw

            by AdoptOpenJDKJava

            jdk-api-diff

            by AdoptOpenJDKJava