How to obtain a performance profile of Java program

Explain how to obtain a performance profile of my Java Program.

To improve the performance of a program, performance analysis is used. The usual purpose of this analysis is to determine which sections of a program to optimize which means to increase its overall speed, decrease its memory requirement or sometimes both. This analysis is called Profiling.

The Java2 platform provides profiling capability using Heap Analysis Tool (HAT). The heap analysis tool analyzes profile reports of the heap. The heap is a block of memory the JVM uses when it is running. The heap analysis tool generates reports on objects that were used to run application. Not only we can get a listing of the most frequently called methods and the memory used in calling those methods, but we can also track down memory leaks. Memory leaks can have a significant impact on performance. To obtain performance profiles of My Java program run the application with –Xrunhprof.

For Example: java -Xrunhprof My Javaprogram

The IDE like eclipse has The Eclipse Test & Performance Tools Platform (TPTP) which provides profiling tool for identifying and isolating performance problems such as performance bottlenecks, object leaks and system resource limits. The tool targets applications of all levels of complexity, from simple standalone Java applications to Eclipse plug-ins or complex enterprise applications running on multiple machines and on different platforms.
Why doesn't Java run on all platforms?
Java runs mostly on all platforms. For running a Java program we need JVM on all the platforms. If JVM is not installed on any platform than we are not able to run ...
Access native OS calls from a Java program
To access native operating system calls from my Java program JNI is used. Java native Interface (JNI) is a programming framework that allows Java code...
How do we create and use sockets in Java?
A socket is a software endpoint that establishes communication between a server program and one or more client programs...
Post your comment