Skip to main content

To Obtain GC details from running java process whithout adding the GC monitoring parameters in jvm args

Just wanted to share a tool for GC Monitoring.

If you’ve forgotten to enable GC logging, or wanted to monitor GC in the middle of the load test, there is a good substitute to watch how GC operates over time.

jstat is the tool of choice. jstat can provide good visibility into GC for a live program. jstat provides nine options to print different information about the heap; jstat -options will provide the full list.
One useful option is -gcutil, which displays the time spent in GC as well as the percentage of each GC area that is currently filled. Other options to jstat will display the
GC sizes in terms of KB.

jstat takes an optional argument—the number of milliseconds to repeat the command—so it can monitor over time the effect of GC in an application.

Syntax : jstat -gcutil <pid> <Milli Sec to repeat>

Here is some sample output repeated every second:
Ø jstat -gcutil 90776 1000

      S0     S1     E        O         M     CCS    YGC  YGCT    FGC    FGCT     GCT
80.52   0.00  12.98  45.07  95.85  91.20   4808  296.955    42   18.608  315.563
80.52   0.00  12.98  45.07  95.85  91.20   4808  296.955    42   18.608  315.563
80.52   0.00  12.98  45.07  95.85  91.20   4808  296.955    42   18.608  315.563

When monitoring started, the program had already performed 4808 collections of the young generation (YGC), which took a total of 296.955 seconds (YGCT). It had also performed
42 full GCs (FGC) requiring 18.608 seconds (FGCT); hence the total time in GC (GCT) was 315.563 seconds.

Since the sample was taken after the no load test and since there is no active load, so the readings were same.

All three sections of the young generation are displayed here: the two survivor spaces (S0 and S1) and eden (E). Then old generation (O) and MetaSpace (M).


Popular posts from this blog

Steps to Analyze AWR Report in Oracle

Steps to Analyze AWR Report in Oracle
AWR -Automaticworkload repository is a collection of persistentsystem performancestatisticsowned by SYS. It resides in SYSAUXtablespace. Bydefault snapshot are generated once every 60 min and maintained for 7 days. Each snapshot has a unique ID know as "snap_id". Snapshot detail can be found in "dba_hist_snapshot" view.
If we have Database performance issue and not the Database machine, then AWR Report is the place to look at. AWR is not used for real-time performance monitoring like the v$ tables. It is used for historical analysis of performance. AWR complements, but doesnot replace real-time monitoring.
Once AWR Report is generated in Oracle, the next task is to analyze it. By going through the AWR Report we can easily solve issues like slow database, high wait events, slow query and many more issues. Even though the report is lengthy, Analyzing or Reading relevant part of AWR Report can help to troubleshoot issues in easy and …

Recording Jmeter Scripts behind a proxy server

Recording Jmeter Scripts behind a proxy server
In one of the blog we saw the steps of recording Jmeter scripts using a proxy server.
JMeter has its own in-built Proxy Server, theHTTP(S) Test Script Recorder. This is only used for recording HTTP or HTTPS browser sessions as explained in below link.
The above steps will work properly if the internet connection is not behind a proxy and can be accessed directly.
If we are testing from behind a firewall/proxy server or if we the internet access is provided using proxy server then the above steps will fail and will not record any of the steps.
Steps to record in Jmeter if the internet is accessed via proxy:
1.Start Jmeter with the firewall/proxy server hostname and port number. To do so, Open a command prompt in windows and run the jmeter.bat file from a command line with the following parameters: -H [proxy server hostname or ip address]
-P [proxy s…