Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: jstat - Analysis

  1. #1
    Member
    Join Date
    Nov 2017
    Location
    USA
    Posts
    58
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default jstat - Analysis

    jstat is a simple utility tool, that is present in JDK to provide JVM performance-related statistics like garbage collection, compilation activities. The major strength of jstat is its ability to capture these metrics dynamically when JVM is running without any pre-requisite instrumentation. What do we mean by it? Say for example if you want to capture garbage collection related statistics, you need to pass below arguments before you start the JVM:

      -Xlog:gc*:file={file-path}

    This argument will enable GC logs and print them in the specified file path. Say suppose you havenít passed this argument, then GC related statistics will not be generated. This is where jstat can come handy. Dynamically you can connect to JVM and capture GC, compilation related statistics as shown below.

    [b]How to launch jstat?[b]
    Execute below command. Itís a simple option to launch jstat.

     jstat -gc -t 11656 10000 30

    [b]-gc[b]: garbage collection related statistics will be printed

    -t timestamp since JVM was started will be printed

    11656: target JVM process Id

    10000: statistics will be printed every 10,000 milliseconds (i.e. 10 seconds).

    30: statistics will be printed for 30 iterations. Thus, the above option will cause the JVM to print metrics for 300 seconds (i.e. 10 seconds x 30 iterations).

    Data generated by jstat
    When you launch jstat with above options, here is the output that will be generated:

    Read More here: "https://blog.gceasy.io/2019/11/18/jstat-analysis/"

  2. #2
    Junior Member
    Join Date
    Mar 2020
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: jstat - Analysis

    Thanks for sharing this with me. I am a college student and was looking for some information regarding Java for my assignment and found this website to be very helpful and informative.

Similar Threads

  1. GC Log analysis compliments APM
    By Ram Lakshmanan in forum Java Programming Tutorials
    Replies: 0
    Last Post: November 28th, 2018, 05:01 AM
  2. Regular Expression for log analysis
    By ankita shukla in forum What's Wrong With My Code?
    Replies: 0
    Last Post: December 20th, 2017, 02:13 PM
  3. Vibration Analysis on Android
    By Anthony87 in forum Android Development
    Replies: 1
    Last Post: February 21st, 2014, 09:47 PM
  4. I need some analysis on a project.
    By Rain_Maker in forum Java Theory & Questions
    Replies: 1
    Last Post: February 17th, 2013, 10:27 PM
  5. Big O - Algorithm Analysis
    By PeskyToaster in forum Java Theory & Questions
    Replies: 4
    Last Post: March 15th, 2012, 11:48 PM