General information
Java profiler face up to the complex subject of performance analysis of huge java applications. The performance analysis of enterprise, web and desktop applications has got a very complex structure as the capacity is not used up with one single algorithm (e.g. during a simulation), but rather ooze away in the thousands of methods, which in the end form the business logic.
Profiling
In order to find the weak points of an application it is often not sufficient to simply count the calls of a function or to sum up the call times. The reason for this is that within one application various callers apply different methods and the time pattern varies with each caller. Here the Java profiler helps out as it keeps a record of each function call, and each call comes with a stack trace. For this reason, the Java profiler is good not only for performance analysis but also for code analysis.
Download
On Micromata’s websites you will always find the most updated version of the Java profiler.
Athttp://sourceforge.net you will find public forums regarding this project.
Licence
This programme is published under the GNU General Public Licence conditions.
Installation
Fundamentals
* ant version 1.4 or up-to-date
* Java JDK1.2 or new
* gcc under Unix, or Microsoft Visual C++ under Windows
* jprofiler.tar.gz
Within the jprofiler.tar.gz there is already a compiled version for windows and Linux/glibc2.2.
Compiling
Once you extracted all data from the jprofiler-1.1.tar.gz archive and put it into a directory folder of your choice it is enough to call ant within the newly created directory folder jprofiler-1.1 in order to compile the java_eprofiler. In doing so – depending on the platform – the native profiling library libjprofiler.so or jprofiler.dll is created as well as the Java-based profile viewer compiled.
Installation Win32
In order to use the java profiler under Windows the profiling library jprofiler.dll has to lie in one of the directories of PATH.
Installation Unix
In order to use the java profiler under UNIX the profiling library libprofiler.so has to lie in one of the directories of the LD_LIBRARY_PATH.
Application
Profiling of a Java application
configuration
Before applying the java_profiler for a java application, you should define the division and name spaces in the data files jprofile.include and jprofile.exclude for which you want to have a profile. In the jprofile.exclude at least the standard libraries should be listed::
file:jprofile.exclude |
|
| 1 2 3 4 5 6 |
java. javax. com.sun sun. org.apache org.xml |
Or you can put your name spaces into the jprofile.include:
file:jprofile.include |
|
| de.micromata. |
Should conflicts occur between those two data files, the listing in jprofile.exclude has got priority.
call
Start your application as usual in the prompt and type in the additional VM parameter –Xrunjprofiler: java-Xrunprofiler-class path….classname args. Whilst the application is running, for each thread a data file, which starts with java.prof., is created in the current directory, This will record the current call path.
When ending the application with SIGQUIT under UNIX or [Ctrl] – [Pause] under Windows the actual java.prof data file is being generated from these individual data files. Should you want the results to be displayed in a different file, because for instance various processes are running in the same directories, then you can give the data file name when starting the application: Java-Xrunjprofiler:server.prof-classpath…classname args.
The XML data file that is being generated through this includes all function calls and their duration, which the application has processed. In order to create a graphic interpretation you now start the display through calling the command jprofiler.sh under UNIX or jprofiler.bat under Windows respectively.
operation
Menu
- With ‘File Open’ you can select a file other than the standard java.prof.
- With ‘Print-File’ you can save the current selected TreeMap as a graphic.
Mouse
After having opened a profile you can use the mouse buttons as follows in order to navigate in the TreeMap:
* left mouse button enables you to zoom in by one level
* middle mouse button selects all calls of the chosen functions
* right mouse button enables you to zoom out to the highest level
As a tool tip you receive the stack trace of each function. In the table view all functions that are called by the selected function are listed with the amount of calls and the total duration of these calls. Functions selected with the left mouse button in the table are automatically selected.





