Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling tool for Java Based Webapplication

We are working on a web-application which preliminary using Struts2+Spring 3.x+Hibernate 3.x.We are taking in to consideration of using good profiling tool to avoid any potential problems.

i am new to this area so while doing some research came up with these two candidate

  • Jprofiler
  • VisualVM

please provide your feedback on these two or if there is any other good candidate please suggest. i also have few more queries regarding this.

  1. How relevant to use profiler as the project is still in middle.
  2. Since we will use this initially on the development system so i don't think it is a replica of production and there may be many issues which are just out of scope in production.
  3. How much an OS can make difference in profiling results as most of the development machine will be window based while the staging and production will be Linux based.

Please provide your valuable feedback.

like image 576
Umesh Awasthi Avatar asked Nov 27 '25 09:11

Umesh Awasthi


1 Answers

Go with JProfiler. I been using this for 3 years, it is really awesome especially for CPU profiling. VisualVM do not provide the kind of drill down that JProfile does. It recognizes J2EE components and also gives you exact SQLs fired in a flow.This is really important, from my experience, 95% of the performance issues comes from irresponsible and unnecessary DB hits.

Because you are using Hibernate, profiling will help you to identify when to enable lazy loading and when to enable object, query and association caching.

To answer your other questions,

  1. It does not matter at what stage your project is, if you feel it is not performing well, profiling is relevant for you. Do not delay it because if the issue is in design of core component there are chances that it will spread throughout the application and difficult to fix it in later stages.

  2. duffymo's answer.

  3. A lot of difference. Our Linux machines with same configuration usually much faster and responsive than Windows machines. But as duffymo answered, profiling gives you hotspots and percentage of time taken by each component and method. Application classes instrumented for profiling are at least 50% slower than normal scenario(my experience with JProfiler).

like image 125
Adisesha Avatar answered Nov 28 '25 22:11

Adisesha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!