Showing posts from December, 2016

Beaware!!! with NewRatio while using Concurrent Mark Sweep GC as Garbage Collector

In Sun JDK there were few bugs previously with subject “ JDK-6872335 : NewRatio ignored when UseConcMarkSweepGC set”. Although these bugs are fixed, but IMO the bug still exists for default settings of NewRatio when UseConcMarkSweepGC is used. We still have the bug where the default NewRatio=2 is not considered along with UseConcMarkSweepGC Option #1 : Default GC (-XX:+UseParallelGC) : PSYoungGen      total 1835008K = 1.75GB (As it considered the default NewRatio=2) # /usr/bin/java -server -Xms6144m -Xmx6144m -XX:MaxMetaspaceSize=256m -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -version -XX:InitialHeapSize=6442450944 -XX:MaxHeapSize=6442450944 -XX:MaxMetaspaceSize=268435456 -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC java version "1.8.0_60" Java(TM) SE Runtime Environment

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   

Command to obtain complete details of a process running in windows

Just wanted to share a command in Windows, to obtain complete details of the processes running in windows. In Unix/Linux we use the below command to obtain all the java processes running on particular server: ps -ef|grep java which shows the PID, command line and other details. The same can be obtained in windows OS. Using Task Manager to show the command line option, the display value is so long that the CLASSPATH setting gets cut off and complete details are not obtained. To show the entire command line including switches/options is to use the WMIC command: C:\> WMIC process where caption="java.exe" Open an windows CMD prompt, execute the following "Windows Management Instrumentation Command-line" (WMIC): To obtain processid and commandline provide the arguments as get C:\> WMIC process where caption="java.exe" get processid,commandline Note: You can pipe the result out to a file like below: (Open cmd prompt