≡ Menu

WebSphere

In this free ebook, I introduce 9 free tools that can be life savers in managing Java Applications. These tools have been time tested, reliable and have helped countless Application Support Engineers and Developers. They DO WORK. These tools can be used to solve problems ranging from ‘Out Of Memory’ errors to ‘Slow’ Applications.

Enjoy.

Troubleshooting using Java Thread Dumps – Part 3

Alright. Now let us dive into step-by-step procedure on actually analyzing the Thread Dump.

Step by Step procedure to analyze a Thread dump

1. Open the Thread dump in your favorite text editor.
Note: Java Threadump (aka javacore) is generally a text file that can be opened using any text editor. If you cannot open it, chances are it is not a JVM thread dump. Perhaps you are trying to open a heap dump or an Operating System core file.
2. Search for the string RUNNABLE. If you are running IBM JVM, look for the string “state:R”.
3. There can be lot of RUNNABLE threads. What you want to do is pay attention to the Threads that are running your application code. They will be evident from stack trace. Look for com.<companyname>.<packagename>.<classname>.<methodname>. You can ignore Application Server specific Threads. It is not unusual to see tons of Application Server threads (for example listen sockets) in the Thread dump.
Example: The Thread below is clearly NOT running your application code at that moment
because it does not show any “com.<companyname>.<packagename>.<classname>.<methodname” in its stack trace.

Read More

Troubleshooting using Java Thread Dumps – Part 2

Okay. Now that you have some fundamentals drilled in, let us look at how exactly to take the Thread Dump. But even before that, let us answer this question:

Does taking Thread dump kill the Application Server? Are there any side effects?

When you take the Thread dump, the JVM is momentarily paused to dump the stack. This does mean that the JVM is interrupted. But that’s about the effect taking the Thread dump should have on the JVM – a momentary pause. However since it is somewhat intrusive process, there is an extremely rare possibility that it does something adverse to the JVM, like getting aborted.  But in practice the cases like this are virtually none.

How do you take a Thread Dump of a JEE Application Server?

Read More

Troubleshooting using Java Thread Dumps – Part 1

‘Threads’ is perhaps the most misunderstood component among Application support engineers and even among Software Developers. Take a look at the following questions that we typically come across in our glorious support career:

  1. What does it mean to say ‘There must be hung Threads’ in the Application?
  2. Have you exhausted the available Threads in Application Server?
  3. Which Thread Pool is used for Web Container?
  4. Do I have to configure the number of JDBC Connections in the connection pool equal to the number of Threads I have in the Application Server?
  5. How can I find out which thread is currently running in the Application Server?
  6. Is ‘number of Threads’ configurable? Can I have unlimited Threads?
  7. How can I find out all Threads that are currently running?
  8. Is there a Thread Dead Lock going on?
  9. How can I kill hung Threads?

Well, after going through this three part series, you will be able to answer all the above questions.

What is a Thread?

Read More

Download Free Poster – Important Java command line options

Hi all !

I have put together a one page poster showing the important Java command line options. Download it, print it and stick it in your cube. It will come in handy.

Enjoy !!

PS: It may take about 30 seconds to load

java_options

 

 

 

A free life-saving Windows tool you never knew existed

Have you ever tried to find out the entire command line arguments for the ‘java’ command that starts your application in Windows ? Have you ever tried to find out which files or DLLs are opened by your Java Application in Windows ? The Windows Task Manager is OK but it does not give you the deeper insight that you would need to answer the above questions. Welcome to Process Explorer.

Read More

5 things you need to know about Java8, NOW !

Oracle’s latest edition of the world’s biggest software platform, Java 8 was released on March 2014. Here are the 5 things you need to know about this edition of this marvelous language.

1. Introduction of Lambda Expressions.

Read More

Top 10 reasons why your Enterprise Java Application is slow

Let’s face it. Nobody likes a slow application. It is our job to make sure our applications  fulfill the functionality need completely, but at the same time delivers good user experience.

In 16 years of my experience in technical support primarily in the world of JEE, while I cannot honestly say ‘I have seen it all’, I can say “I have seen a lot“. Here are the top 10 reasons why your Java application may slow.

Read More

One important change in Memory Management in Java 8

Oracle’s latest edition for Java – Java 8 was released in March 2014. As usual, tons of new features have been added. There is one major change in the Memory management area that I want to discuss today.

“So long PermGen, Hello Metaspace !!”

Oracle has completely gotten rid of ‘PermGen’ and replaced it with Metaspace.

What is PermGen ?

Read More

Top 4 Java Heap related issues and how to fix them

Java heap related issues can cause severe damage to your application that will directly result in poor end user experience. Care must be taken to tune the Heap related parameters that suit your application. Out of the box default parameters are not enough.

Quick overview:

Java Heap is the memory used by your application to create and store objects. You define the maximum memory that can be for the Heap by specifying ‘-Xmx<size>’ java command line option (Example: ‘-Xmx1024m‘, where m stands for Mega bytes). As your application runs, it will gradually fill up Heap. JVM periodically runs a process called ‘Garbage collection’ (GC) which will scan the heap and clear objects that are no longer referenced by your application.One cannot request Garbage Collection on demand. Only JVM can decide when to run GC.

Let me walk you through four of the most common Java Heap related issues and how to fix them.

Read More