Friday May 17, 2013

Troubleshooting Tools Part 3 - Heap Dumps

A Heap Dump is a snapshot of the Java process heap memory at a given time.  It's a useful tool to troubleshoot memory leaks and other memory related issues.  Heap dumps are to memory what thread dumps are to java threads.

There are different ways to dump the java heap used by a Java application such as WebLogic Server.  Heap dumps can be triggered automatically by JVMs such as HotSpot or JRockit when an OutOfMemory event occurs.

Example:

java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\myApp\hprof-dumps myApp  

This command will generate a heap dump file in the defined heap dump directory when an OOM is thrown.  

The file will be in HPROF binary format (*.hprof).  If no path is defined the file will be created in the directory from which the java process was launched.  The format of the file with JRockit is jrockit_pid,hprof, pid being the process ID of this JVM instance.  With HotSpot the format of the file will be java_pidpid.hprof.

Example:

java.lang.OutOfMemoryError: Java heap space

Dumping heap to D:\java_pid4148.hprof ...

Heap dump file created [24921731 bytes in 1.400 secs]

For WebLogic Server these properties, HeapDumpOnOutOfMemoryError and HeapDumpPath (optional), can be added directly to the startup script that contain the Java command that launches WLS.  On Windows the script (with default name startWebLogic.cmd) lives in the domain bin directory and the parameters can be directly added to the existing JAVA_OPTIONS.

With a JRockit VM process the following command can also be used to generate a heap dump.

Example:

jrcmd pid hprofdump filename=name_of_dump_file

However if you are using this command against a non JRockit process the following error will come up:

java.io.IOException: Command failed in target VM

You can also manually generate a heap dump with tools such as jmap or VisualVM.

Example:

jmap -heap:live,format=b,file=filename pid

This command will generate a heap dump file in binary format and will only count live objects (the live option is optional). Live objects are used by applications and generally reside in the Young Generation part of the heap.

As illustrated in the screenshot below, generating a heap dump with VisualVM is very simple.  VisualVM is shipped as part of the HotSpot JVM  (/bin/jvisualvm.exe).  However, VisualVM can connect to java processes that started with other JVM such as JRockit.


Once generated, the heap dump will be parsed as shown below:

VisualVM enables you to browse heap dumps as shown above with the Classes view where you can easily identify the number and percentage of instances referred by each class.

jhat can also be used to analyze heap dump files.

Example:

jhat dumpfile

Reading from dumpfile...
Dump file created Fri May 17 15:25:41 PDT 2013
Snapshot read, resolving...
Resolving 580390 objects...
Chasing references, expect 116 dots.............................................
.......................................................................
Eliminating duplicate references................................................
....................................................................
Snapshot resolved.
Started HTTP server on port 7000
Server is ready.

Then you can open http://localhost:7000/ to navigate through the content of the dump file to identify objects with high number of occurrences.

Finally, as shown below, the OpenSource Eclipse MAT offers a very rich GUI that includes histograms and leak hunter actions, overview and leak suspect reports and much more.


Previous posts on troubleshooting tools:

Troubleshooting Tools Part 1 - VisualVM

Troubleshooting Tools Part 2 - jstack

Tuesday May 14, 2013

WebLogic Server on Oracle Database Appliance - How to configure a WebLogic cluster

How to configure a WebLogic cluster on Oracle Database Appliance?

It's easy with the support of Appliance Manager, WebLogic configuration for Oracle Database Appliance!

Follow the wizard driven process, you can deploy and set up a WebLogic cluster just in hours!

  1. Pick the WebLogic version. In our 2.5 release, you can choose either WebLogic 12c (12.1.1) or 11g (10.3.6).
  2. Choose the size of cluster, you can set up a 2, 4 or 8 node cluster.
  3. Input your networking information.
  4. Input load balancer networking information.
  5. Input the data source configuration information as optional.
  6. Done. Ready to deploy!

It's simple, easy and straightforward.

Enjoy!


Oracle Traffic Director - download and check out new cool features in 11.1.1.7.0

As Oracle's strategic layer-7 software load balancer product, Oracle Traffic Direct is fast, reliable, secure, easy-to-use and scalable; that you can deploy as the reliable entry point for all TCP, HTTP and HTTPS traffic to application servers and web servers in your network.

The latest release Oracle Traffic Director 11.1.1.7.0 is available for ExaLogic and Database Appliance! For download and details please visit the Traffic Director OTN website.

It this release, we have introduced some major new functionality and improvements.

Web application firewall. Oracle Traffic Director supports web application firewalls. A web application firewall (WAF) is a filter or server plugin that applies a set of rules, called rule sets, to an HTTP request. Using a web application firewall, users can inspect traffic and deny requests to protect back-end applications from CSRF vulnerabilities and common attacks such as cross-site scripting.

WebSocket Connections. Oracle Traffic Director handles WebSocket connections by default. WebSocket connections are long-lived and allow support for live content, games in real-time, video chatting, and so on.

Support for LDAP/T3 Load Balancing. Oracle Traffic Director now supports basic LDAP/T3 load balancing at layer 7, where requests are handled as generic TCP connections for traffic tunneling. It works in full-NAT mode.

Please download and try it out. For more information, check out the data sheet and the documentation:

http://www.oracle.com/us/products/middleware/application-server/oracle-traffic-director-ds-1389582.pdf

http://docs.oracle.com/cd/E23389_01/doc.11116/e21036.pdf


About

The official blog for Oracle WebLogic Server fans and followers!

Stay Connected

Search

Archives
« May 2013 »
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
15
16
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today