Profiling Your Java Application

Three common problems related to the java application performance can be categorized into three types:

  • High CPU Contention
  • Deadlock
  • Memory Leak

Sometimes its really really hard to find the object that causing those problem, but with nowadays feature for heap profiling since jdk1.4 help us to identify our root problem.

usually we can run those feature using -XX option, for example:

java -Xms32m -Xmx64m -Xrunhprof:heap=dump,monitor=y,cpu=samples,thread=y,file=<dir>

with those option we can snapshot statistic of the JVM behavior and analyze the result with your favorite tools. Based on my experience of troubleshoot the application usually i use two tools IBM HeapAnalyzer (tool to identify the memory leak problem), and PerfAnal (tool that provide an analysis of CPU contention problem).

I think it become more and more obvious, that developing application with Java will give you a full control of the application itself.

Advertisements

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: