Java Performance Tuning

Performance Tuning must be approached as an experimental science: To do it properly, you have to construct experiments, perform them, and from the result construct hypotheses. (Foreword of Java Performance book, Hunt and John et. al)


Performance tuning Java is as much an art as it is a science. Understanding the intrinsic performance characteristics of method calls, heap allocations, and casts is essential for developing efficient code at the micro level. Understanding the overall performance of applications as a whole is essential for developing efficient algorithms at the macro level. It’s critically important in all cases to measure in several different ways and to double check that those measurements are consistent. (From EclipseCon 2013, Ed Merk’s talk)

Contents (covers the topics)

Mainly, i search and focus the topics below

PERFORMANCE TESTING: Defining performance and performance tuning, Defining the user experience, Psychology of performance tuning, Performance tuning methodology, Performance tuning model, System monitoring, Response time budgeting, Usage patterns, Test harnesses, Load, stress, and endurance testing, Micro and macro benchmarking, Analysis of benchmarking results, Factors that affect benchmarks

ALL ABOUT THE JVM: HotSpot internals, HotSpot monitoring, HotSpot tools, HotSpot tuning, Memory management, Garbage collection basics, Garbage collection algorithms, Object Lifecycle, Monitoring garbage collection, Tools for garbage collection analysis, HotSpot and Garbage collection exercises

PUTTING IT ALL TOGETHER: Tools to find latency, JDBC monitoring, Java Management eXtentions (JMX), Thread profiling, Execution profiling, Thread monitoring, Memory profiling, Memory leak and loitering objects


JAVA applications are written by the software developers, and sent the staff for deployment. Software developers should realise testing before deployment phase. In addition, depending on the application server, configuration of parameters (e.g., JVM ) are also required. The process requires the steps below:

Before Deployment, Software developers need to realize: 1-Static code analysis, 2-Unit Tests 3-Load test

For server deployment, 1-Specifying JVM parameters and Data source parameters (in case of DB connection) depending of the application server vendor.

2- Monitoring Application (e.g. logging run time parameters). After gathering results, initial settings of the application may subject to change.

About static code analysis tools

Sonar is a tool for static code analysis. It produces graphs, charts, and generally allows you to slice and dice your Java code analysis in multiple ways. However, it does run as a server, which can require privileges on your machine/network that you might not have.

FindBugs helps you find bugs in your Java source code.

PMD helps find bugs in different ways from FindBugs.

CheckStyle helps ensure that your code conforms to certain style guidelines.

Cobertura instruments your Java bytecodes and analyzes which source code lines are exercised by your unit tests.

Follow page
Message Berkay Celik
Report link