Tag: JRockit

Why and How Oracle JRockit?

Hi,

Jay SenSharma

Jay SenSharma

Many JDKs are available in the Market which can be used anywhere like Production/Development Envs Like — Oracle Sun JDK, Oracle JRockit JDK, IBM JDK…etc. It is true that JRockit is specially designed for Production Environments and Oracle recommends that you use JRockit JDK with your Oracle products …because it has a Best Enhanced Garbage Collection Strategies, It have a JRMC tool inbuilt to Monitor the JVM Activities in the Runtime with very less Burden on the Server/JVM.

.

Why JRockit is More Recommended for Production Environments ?

– It Has More diagnostic tools than other JDKs such as JRA
– Management console with no overhead on performance (JRMC)…which is available inside <JROCKIT_HOME>bin directory.
– Better performance on Intel architectures than other JVMs
– Higher memory usage for better performance
– Great code Optimization Stretegy. (Can be Disabled using -Xnoopt is you dont want optimization)

How to tell Our WebLogic to use JRockit JVM ?

Step-1). Set the JAVA_HOME environmental variable in
<MIDDLEWARE_HOME>/common/bin/commEnv.cmd (commEnv.sh) to the appropriate path.
Example Location: C:Bea1033wlservercommonbin

Step-2). Set the JAVA_VENDOR environmental variable in
<MIDDLEWARE_HOME>/common/bin/commEnv.cmd (commEnv.sh) to BEA.

NOTE: Above two Steps are required only when you want that All your Newly created Domains as well should automatically pick the JRockit JVM Only.
If you already have some Existing Domain then you can do this in your  “<DOMAIN_HOME>binsetDomainEnv.sh” set the Correct JAVA_HOME and Correct JAVA_VENDOR Like below:

Setting JAVA_HOME & JAVA_VENDOR to use JRockit

Setting JAVA_HOME & JAVA_VENDOR to use JRockit

Step-3). If already you have mentioned some JVM tuning parameters in your StartScript like startWebLogic.sh or setDomainEnv.sh then Please make sure that they are compatible to the JRockit JVM
Example:
(Sun JDK) -Xmn, -XXNewSize, -XXMaxNewSize    —->  (JRockit)   -Xns
(Sun JDK) -XX:+UseConcMarkSweepGC                   —->  (JRockit) -Xgc:singlecon
(Sun JDK) -XX:+UseParallelGC                                     —->  (JRockit) -Xgc:parallel
(Sun JDK) -verbose:gc                                                      —->  (JRockit) -Xverbose:memory

Note: -XX:MaxPermSize (perm Gen Size Setting is only available for Sun JDK and Not for JRockit so please remove this JVM Tunning parameter if you are going to use JRockit)

Additional Features  With JRockit?

You can use the JRMC tool which comes with the JRockit JDK to monitor the Runtime Activities of the JVM. As describeed in the following Link:
You can even use some common Command Line Debugging utilities like following:

jrcmd <pid> print_threads (To Collect JRockit Thread Dump)

JRCMD_Collecting_Thread_Dump

JRCMD_Collecting_Thread_Dump

jrcmd <jvmpid> print_object_summary (Displaying Object Summary Details)

JRockit_JRCMD_Collecting_ObjectSummary

JRockit_JRCMD_Collecting_ObjectSummary

jrcmd <jvmpid> heap_diagnostics (For Heap Monitoring)

Heap_Diagnostic_Using_JRCMD

Heap_Diagnostic_Using_JRCMD

jrcmd <pid> print_properties (Printing System properties including CLASSPATH/PATH…etc)

Printing_Properties_Using_JRCMD

Printing_Properties_Using_JRCMD

jrcmd <jvmpid> verbose_referents

.
.
Thanks
Jay SenSharma


Taking Thread Dumps

Hi,

Jay SenSharma

Jay SenSharma

Thread Dumps are one of the very important JVM reports which we can use to analyze Server/JVM Hang Situations and the Root Cause of it… Here are few very common techniques which we can use to take Thread Dumps…

Note: Taking only one or two Thread Dumps is not very useful. Always make sure that you collect atleast 5-6 Thread Dumps taken in the interval of 10-12 Seconds….Ehich will be really helpful to investigate the Hang Situation.

————————————————–

Option 1). In Windows Machines:   Just Press (Ctrl + Break) Buttons together in the CommandWindow ehere your Server in running.

In Solaris/Linux …etc Unix Based Boxes you need to findout the Servers Process ID…by running the following command from the Same box where the Server is running:

A). ps -ef | grep java

qProcessbox 20650 1   0   Mar 26 ?         104:51 /opt/app/qProcessbox/java/jdk1.5.0_22/bin/java

B). Now use     kill -3 20650

Syntax:  kill -3 <ProcessID>

The OutPut of the Thread Dump will be generated in the Server STDOUT.

————————————————–

Option 2). We can Collect Thread Dump Using “weblogic.Admin” which is deprecated …but still available …and may be available in near future as well…As i think because it is one of the best debugging utility for Admins.

java weblogic.Admin -url t3://AdminHostName:7001 -username weblogic -password weblogic THREAD_DUMP

java weblogic.Admin -url t3://MS1HostName:7003 -username weblogic -password weblogic THREAD_DUMP

java weblogic.Admin -url t3://MS2HostName:7005 -username weblogic -password weblogic THREAD_DUMP

The THREAD_DUMPS will be generated in the Servers STDOUT file.  If you want to See the Thread Dump In your Same Command Window Where you are running the “weblogic.Admin” utility…then Enable the “redirect-stdout-to-serverlog” Or by adding the JAVA_OPTION in serverStartScript (-Dweblogic.log.RedirectStdoutToServerLogEnabled=true) flag from Admin Console…sothat the STDOUT entries also will be redirected to the Server Logs…then you can read The Server Logs using the following command remotely/locally.

java weblogic.Admin -url t3://MS2HostName:7005 -username weblogic -password weblogic SERVERLOG
————————————————–

Option 3). Through WLST you need to write the WLST script like “AdminThreadDump.py” In this case you will see the Thread Dumps on the Same Shell Prompt…. not need to look into the Server STDOUT

connect('weblogic','weblogic','t3://localhost:7001')
cd ('Servers')
ls()
cd ('AdminServer')
ls()
threadDump()
cd('..')
cd('ManagedServerOne')
threadDump()

Now open a command Shell and then run the “setWLSEnv.sh”

then run the WLST script like:

java weblogic.WLST AdminThreadDump.py
or
java weblogic.WLST /opt/bea/MyScripts/AdminThreadDump.py
=====================================

Option 4). Simplest option to take Thread  Dump is :

Login to AdminConsole—>Server —> Monitoring —> Threads

Option 5). You can even collect THREAD_DUMPS using JMX code like mentioned in the below link …using “JVMRuntimeMBean”     taking-threaddump-along-with-jrockitruntime-details/

Option 6). Taking ThreadDump Using T3ServicesDef

Option 7). Collecting Thread Dumps Using Jstack utility

Option 8). If you are using WebLogic Server as a Windows Service then you can collect the Thread dump as Described by Former GSS India Oracle Mentor SriDevi :http://middlewaremagic.com/weblogic/?p=823#comment-1011

Option 9). Taking the JVM Details (Heap size and Jdk Details including OS details) including Thread Dump:

java weblogic.Admin -url t3://ServerHostName:7001 -username weblogic -password weblogic GET -pretty -type JVMRuntime

Collecting Thread Dump Using JVMRuntime

Collecting Thread Dump Using JVMRuntime

.

.

Thanks

Jay SenSharma


Copyright © 2010-2012 Middleware Magic. All rights reserved. |