JProfiler's interface is user friendly and very fast in achieving the goal that came from the need to use an analyzing tool, which is, to show the performance statistics about the selected application and the possible leaks.
Jprofiler is one of the most used Java Profiler for Java-based standard and enterprise. JProfiler is a commercially licensed Java profiling tool developed by ej-technologies GmbH, targeted at Java EE and Java SE applications. Features edit This section contains content that is.
JProfiler offers two different kinds of sessions:
Local sessions which allow you to assemble the information required to start and profile your application in a point and click interface.
Remote sessions which allow you to attach to any externally started Java application, even on a different computer. This type of session can be used to profile virtually any Java application server. Fatty bears birthday surprise demo.
Steps to connect remote host
Download the jprofiler from here : https://www.ej-technologies.com/download/jprofiler/files
1) run the jprofiler_linux_7_2_3.sh script in the local in order to install the jprofiler ui
2) copy the jprofiler7 directory to the remote machine
-in remote machine start the agent and provide the port
[remote@localhost] cd jprofiler7/bin/
[remote@localhost]$ ./jpenable
Connecting to org.apache.catalina.startup.Bootstrap start [20992] …
Please select the profiling mode:
GUI mode (attach with JProfiler GUI) [1, Enter]
Offline mode (use config file to set profiling settings) [2]
1
Please enter a profiling port
[31757]
8089
You can now use the JProfiler GUI to connect on port 8089
3) Attach the agent in your local [run the jprofiler]
session-integration wizard – new remote integration
and provide the information
Memory leak
Jprofiler 9
To recognize a memory leak in the application go to 'VM Telemetry Views' and if there are linear stripes, then it means that in the application some instances use a lot of memory.
If at the start you have a decent count of instances and on executing a command the number goes though the roof, then there is a 'time bomb' problem. It will crack and it all depends on when. An optimization is in order, try to reduce the number of instances, size. Maybe some objects that are kept alive should be freed by the GC. To detect these objects you can go to 'Heap Walker->Biggest Objects' and see for yourself the tree with the details. There you will have specified the packages and size.
Performance Analysis
The 'Hot spots view' is a bottom-up view. JProfiler also offers a top-down view displaying the entire call tree. While the 'Hot spots view' cumulative times for all invocation paths, the 'Invocation tree' is perfect for finding single bottlenecks by expanding the tree along the large percentage values. It also gives you a feeling for the execution speed of various application components as well as a bird's eye view of the call flow. This view is useful for debugging as well as profiling.
Having trouble with performance and scalability issues is not so uncommon in my working environment as it should be. That is a shame – but there are a lot of pretty tools out there in this java developer world, that can rescue my reputation as a hardworking and serious software craftsman. (The sole existence of such tools gives me the impression that there must be other performance and scalability idiots out there in java world)
A pretty neat thing might be a profiler and there are a lot of good and better ones available. For unknown reasons I personally fell in love with JProfiler many years before and sometimes I tend to evangelize my working mates using it. If you want to try it – the guys from ejtechnologies give you ten days time ;)
Although I used the pretty little thing called JProfiler very often over the years in various environments, I recently stumbled across a problem when I tried to use it with IBMs J9 virtual machine on a 64-Bit Linux. JProfiler has a very good built-in integration wizard that worked very good many times before, but not on the following system environment:
Jprofiler 11
- VMware Server
- Suse Linux Enterprise 11 – 64 Bit
- IBM J9 JDK 1.6
- Apache Tomcat 7.0.27
- JProfiler 7.2.2
So I had to integrate this dream team manually.
- Prerequisite:
- Change tomcat setenv.sh
- Change catalina.sh
- Start Tomcat in profiling mode
- Connect with JProfiler GUI
JProfiler is downloaded and a licence is available.
http://www.ej-technologies.com/download/jprofiler/file
To install JProfiler I unzipped jprofiler_linux_7_2_2.tar.gz to opt/jprofiler.
Afterwards, it can be started by opt/jprofiler/jprofiler7/bin/jprofiler.sh
.
The following line needs to be introduced into the setenv.sh script of your Tomcat installation and is the key of a successfull handshake between the profiler and the JVM started by Tomcat.export LD_LIBRARY_PATH=/opt/jprofiler/jprofiler7/bin/linux-x64
Next thing to do is to configure your JVM with JProfiler agent as a JVM native agent library. Besides that you should configure the agent to open up a server socket for remote connections of the JProfiler GUI.
You can do this for example within your catalina.sh script with the following line
exec '$_RUNJAVA' '$LOGGING_CONFIG' -agentpath:/opt/jprofiler/jprofiler7/bin/linux-x64/libjprofilerti.so=port=6766-Xshareclasses:none $JAVA_OPTS $CATALINA_OPTS -Djava.endorsed.dirs='$JAVA_ENDORSED_DIRS' -classpath '$CLASSPATH' -Dcatalina.base='$CATALINA_BASE' -Dcatalina.home='$CATALINA_HOME' -Djava.io.tmpdir='$CATALINA_TMPDIR' org.apache.catalina.startup.Bootstrap '$@' start
The part in bold letters is the change made to the original script line.
Simply done with the following command catalina.sh run
The output of tomcat console should be like that:
Using CATALINA_BASE: /opt/apache-tomcat-7.0.27-lab1
Using CATALINA_HOME: /opt/apache-tomcat-7.0.27-lab1
Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.27-lab1/temp
Using JRE_HOME: /opt/ibm-java-x86_64-60
Using CLASSPATH: /opt/apache-tomcat-7.0.27-lab1/bin/bootstrap.jar:/opt/apache-tomcat-7.0.27-ab1/bin/tomcat-juli.jar
JProfiler> Protocol version 37
JProfiler> Using JVMTI
JProfiler> Thread status info workaround enabled.
JProfiler> Restricted JVMTI version 1.1 detected.
JProfiler> 64-bit library
JProfiler> Listening on port: 6766.
JProfiler> Instrumenting native methods.
JProfiler> Native library initialized
JProfiler> VM initialized
JProfiler> Waiting for a connection from the JProfiler GUI ..
The Tomcat JVM will run Tomcat only if a JProfiler GUI is connected through port=6766.
Steps to connect remote host
Download the jprofiler from here : https://www.ej-technologies.com/download/jprofiler/files
1) run the jprofiler_linux_7_2_3.sh script in the local in order to install the jprofiler ui
2) copy the jprofiler7 directory to the remote machine
-in remote machine start the agent and provide the port
[remote@localhost] cd jprofiler7/bin/
[remote@localhost]$ ./jpenable
Connecting to org.apache.catalina.startup.Bootstrap start [20992] …
Please select the profiling mode:
GUI mode (attach with JProfiler GUI) [1, Enter]
Offline mode (use config file to set profiling settings) [2]
1
Please enter a profiling port
[31757]
8089
You can now use the JProfiler GUI to connect on port 8089
3) Attach the agent in your local [run the jprofiler]
session-integration wizard – new remote integration
and provide the information
Memory leak
Jprofiler 9
To recognize a memory leak in the application go to 'VM Telemetry Views' and if there are linear stripes, then it means that in the application some instances use a lot of memory.
If at the start you have a decent count of instances and on executing a command the number goes though the roof, then there is a 'time bomb' problem. It will crack and it all depends on when. An optimization is in order, try to reduce the number of instances, size. Maybe some objects that are kept alive should be freed by the GC. To detect these objects you can go to 'Heap Walker->Biggest Objects' and see for yourself the tree with the details. There you will have specified the packages and size.
Performance Analysis
The 'Hot spots view' is a bottom-up view. JProfiler also offers a top-down view displaying the entire call tree. While the 'Hot spots view' cumulative times for all invocation paths, the 'Invocation tree' is perfect for finding single bottlenecks by expanding the tree along the large percentage values. It also gives you a feeling for the execution speed of various application components as well as a bird's eye view of the call flow. This view is useful for debugging as well as profiling.
Having trouble with performance and scalability issues is not so uncommon in my working environment as it should be. That is a shame – but there are a lot of pretty tools out there in this java developer world, that can rescue my reputation as a hardworking and serious software craftsman. (The sole existence of such tools gives me the impression that there must be other performance and scalability idiots out there in java world)
A pretty neat thing might be a profiler and there are a lot of good and better ones available. For unknown reasons I personally fell in love with JProfiler many years before and sometimes I tend to evangelize my working mates using it. If you want to try it – the guys from ejtechnologies give you ten days time ;)
Although I used the pretty little thing called JProfiler very often over the years in various environments, I recently stumbled across a problem when I tried to use it with IBMs J9 virtual machine on a 64-Bit Linux. JProfiler has a very good built-in integration wizard that worked very good many times before, but not on the following system environment:
Jprofiler 11
- VMware Server
- Suse Linux Enterprise 11 – 64 Bit
- IBM J9 JDK 1.6
- Apache Tomcat 7.0.27
- JProfiler 7.2.2
So I had to integrate this dream team manually.
- Prerequisite:
- Change tomcat setenv.sh
- Change catalina.sh
- Start Tomcat in profiling mode
- Connect with JProfiler GUI
JProfiler is downloaded and a licence is available.
http://www.ej-technologies.com/download/jprofiler/file
To install JProfiler I unzipped jprofiler_linux_7_2_2.tar.gz to opt/jprofiler.
Afterwards, it can be started by opt/jprofiler/jprofiler7/bin/jprofiler.sh
.
The following line needs to be introduced into the setenv.sh script of your Tomcat installation and is the key of a successfull handshake between the profiler and the JVM started by Tomcat.export LD_LIBRARY_PATH=/opt/jprofiler/jprofiler7/bin/linux-x64
Next thing to do is to configure your JVM with JProfiler agent as a JVM native agent library. Besides that you should configure the agent to open up a server socket for remote connections of the JProfiler GUI.
You can do this for example within your catalina.sh script with the following line
exec '$_RUNJAVA' '$LOGGING_CONFIG' -agentpath:/opt/jprofiler/jprofiler7/bin/linux-x64/libjprofilerti.so=port=6766-Xshareclasses:none $JAVA_OPTS $CATALINA_OPTS -Djava.endorsed.dirs='$JAVA_ENDORSED_DIRS' -classpath '$CLASSPATH' -Dcatalina.base='$CATALINA_BASE' -Dcatalina.home='$CATALINA_HOME' -Djava.io.tmpdir='$CATALINA_TMPDIR' org.apache.catalina.startup.Bootstrap '$@' start
The part in bold letters is the change made to the original script line.
Simply done with the following command catalina.sh run
The output of tomcat console should be like that:
Using CATALINA_BASE: /opt/apache-tomcat-7.0.27-lab1
Using CATALINA_HOME: /opt/apache-tomcat-7.0.27-lab1
Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.27-lab1/temp
Using JRE_HOME: /opt/ibm-java-x86_64-60
Using CLASSPATH: /opt/apache-tomcat-7.0.27-lab1/bin/bootstrap.jar:/opt/apache-tomcat-7.0.27-ab1/bin/tomcat-juli.jar
JProfiler> Protocol version 37
JProfiler> Using JVMTI
JProfiler> Thread status info workaround enabled.
JProfiler> Restricted JVMTI version 1.1 detected.
JProfiler> 64-bit library
JProfiler> Listening on port: 6766.
JProfiler> Instrumenting native methods.
JProfiler> Native library initialized
JProfiler> VM initialized
JProfiler> Waiting for a connection from the JProfiler GUI ..
The Tomcat JVM will run Tomcat only if a JProfiler GUI is connected through port=6766.
Start JProfiler as mentioned above and then do the following clicks:
Menu Session->NewSession
Attach locally through port 6766
Choose Instrumentation
SessionStartup can be easiliy skipped with 'OK'
Jprofiler 11 Keygen
Congratulations you have reached the next level in your quest for better java web application performance ;)