This is my first technical blog and would like to discuss my experience in profiling JBoss Application Server (EAP/EPP) using JProfiler.
JRebel by Perforce is home to the award-winning Java developer tools, JRebel and XRebel. See how they can help your team build better applications, faster. Prices start from $3,000. Contact us with details of where, when and what. Profile analysis. We can analyze your profiles to determine where your application bottlenecks lie, and suggest changes to improve the performance of your application. Prices start at $1000 per profile analysis. Performance design review.
The following servers/tools are required.
JBoss Application Server (EAP/EPP) – Get the latest JBoss server from http://www.jboss.org/jbossas/downloads/
JProfiler – Please download this profiling tool from http://www.ej-technologies.com/download/overview.html
JDK 1.5 or greater.
The following servers/tools have been profiled using JProfiler while preparing writing this blog.
JBoss EAP/EPP Server
JProfiler 6.1.1
JDK 1.6
Step 1. Once JProfiler is download start the JProfiler using its exe or from start menu. You may see something as below
Step 2. Select the Server to profile. I am using JBoss EPP 4.3 so I am selecting JBoss 4.x server from list.
Step 3. In the next screen you have to specify where this JBoss server resides. If you are trying to profile remote server, you may have to have JProfiler agent running on remote server. In my case, I have my JBoss server in local machine
Step 4. In next wizard you have to specify JVM vendor you have been using in your machine. Please select appropriate JVM vendor, version and Mode. Also please check the box if you are using 64bit JVM! Here are my settings
Step 5. In the next wizard you have to specify whether your application server (JBoss) would like to wait for a connection from JProfiler GUI! I am specifying “wait for a connection from the Profiler GUI” because it is easy to configure and flexible. Here is where I am now.
Step 6. In the next step, you have to specify the batch/script file used to start your application Server. Specify the run.bat location by browsing.
Step 7. In the next wizard, you have to specify the port to be for profiling connection. JProfiler by default uses 8849, check if you have this free (by using DOS command “netstat –aon”) otherwise you may have to change this port. In my case no other application using this port so I am going with the default.
Step 8. We are almost there. Check the required modifications we have done so far then click on Next.
Step 9. By this step, we have done enough configurations and our integration is finished. By this step your application is ready to be profiled and will be automatically started.
Step 10. In the next step, you may have to specify Initial profiling settings whether Instrumentation/Sampling. Instrumentation covers all features to be tune, so I am going with this. Check appropriate settings for your need
Step 11. Once you click Ok in Session Start-up window, you may notice that your JBoss server has already been started. You may see something like
Step 12. Check whether your JProfiler is started JBoss server as well? Check Trouble shooting section if your server is not started with JProfiler. In my case JProfiler started my server.
By this time I assume your Server is running under profiling mode (In fact I would say listening to JProfiler for tuning). Click on “Memory View” in left pane. You may something like below
This screen specifies the number of instances have been created for each class. You may also see the size of those instances occupying in memory.
If you want to check memory leakages for specific classes or at package level first try access your respective webpage through the URL in browser. This creates enough traffic on the server then you may have to change “Aggregation level” and use “Vie Filters” option. Please see below.
I don’t have any application running on my server, but I captured below screen for tuning one of my project.
Jprofiler Price Per
In the above screen I clearly see number of instances have been created and their size for my class/package.
Once you are finished accessing your webpage, try closing the browser and check whether created instances for respective class go down. Ideally since the application is not being accessed, garbage collector should remove the unused objects.
Generally it is up to JVM to run garbage collector, so we can run garbage collector through JProfiler (using Profiling -> Run Garbage Collector option). After running garbage collector (through JProfiler) if you see any variation then there is memory leakage (Problem to worry!)
Jprofiler Price Comparison
Improved CPU hot spot view allows us to quickly see long hot spot values and the view filters now work for non-method hot spots, such as JDBC calls.
To do CPU profiling click on “CPU View” left pane. You may see something like
Again as we did while finding Memory Leakage, you may change “Aggregation Level” and other fields to see thread specific data of your application.
One of the nice features I love is “Call graph”. Click on “Call graph” tab in “CPU View” panel. You may have to select several options to create call graph as below (such as, appropriate thread selection and aggregation Level).
Once you fulfil all options you may something like below. (Again, I don’t have any application running on my server, below screen captured from one of our projects).
Trouble Shooting
If JProfiler doesn’t start your JBoss Server – You may notice JProfiler creates new batch file at your JBoss server run.bat location with the name run_jprofile.bat. Check whether it is there or not. Run this run_jprofile.bat file and then start the same session in JProfiler. If you face any problem comment me, I may help you.
That’s all about profiling experience I had. Please feel free to play around in JProfiler GUI. Happy Profiling!!!
Last but not least, I would really appreciate if you share your valuable comments and caught me if I was wrong anywhere.
Cheers,
Shashi
Solution Categories
ISVs: Let us take care of the hassle of software licensing, services and support, so you can get on with the fun stuff.
Technical Services: From one-off projects to ongoing support, we’re here to help.
Developers: Software and Services to power Developers and boost ISVs.
Mapping SolutionsScreenflow 9 0 20. : Bring the real world to your users.
Vendors
Adobe: Digital experiences and creativity to enhance your brand.
Embarcadero: Developer tools for quick and easy native cross-platform development.
GitHub: Keeping developers productive as a distributed team.
HERE Technologies: Build powerful location-aware web and mobile apps and services using the world’s #1 location platform.
Intel Software: Great tools to boost the performance, capability and reliability of your amazing applications.