JProfiler- Tool to Capture Performance Bottlenecks | HCL Blog

JProfiler-A tool to capture performance bottlenecks

JProfiler-A tool to capture performance bottlenecks
August 24, 2017

In today’s IT world, when we think of delivering a software product or before it goes in Production environment, we want to know about certain parameters whether they are scalable, performance parameters, CPU and memory usage. Many performance problems in enterprise or web applications result from memory (garbage collector) or database access issues.

JProfiler is a Java profiler tool and is useful for developers/testers as it can be used to analyze performance bottlenecks, memory leaks, CPU loads, and to resolve threading issues. JProfiler works both as a stand-alone application and as a plug-in for the Eclipse software development environment. 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.

It is difficult to find memory leak without using the right tool. JProfiler’s heap walker helps you to solve both simple and complex memory problems. JProfiler helps in Organizing Profiling data into view Sections .On left side of the JProfiler's main window view selector is located .Each View section contains Number of views.There are different views and lots of inspections that show different aspects of the current set of objects. Different views include Memory views, CPU views, heap walker, Thread views, Monitor Views, and Telemetry Views. Users can record the live memory and CPU for the particular process by selecting the recording feature in JProfiler.

There are two different types of Profiling in JProfiler. Local Profiling and Remote Profiling. Local Profiling is an analysis of applications that are running on the same machine on which the JProfiler software is installed. Remote Profiling is analysis of Java applications which are running on remote machines where the JProfiler software is not installed. Without starting JProfiler's GUI front end , JProfiler's offline profiling ability allows to run profiling sessions from command line . JProfiler offers a command line tool jpenable that loads the profiling agent and makes it possible to connect with a remote session from another computer. Profiling agent and JProfiler GUI communicate with each other through a socket. JProfiler can profile the information in both cases and allow the user to immediately see live through a visual representation showing the load in terms of active and total bytes, instances, threads, classes, and garbage collector activities.

Among #Java profiling tools, #JProfiler is the most useful for #developers & #testers.

There are three basic aspects to a profiler: A "time profiling" measures the execution paths of your application on the method level whereas "memory profiling" gives you insight into the development of the heap, such as which methods allocate most memory. Most applications are multi-threaded, and "thread profiling" analyzes thread synchronization issues. Because it often makes sense to compare and correlate data from all three domains, JProfiler combines time, memory and thread profilers in a single application.

JProfiler profiling is supported on Windows, Linux, Solaris, AIX,FREEBSD,HP-UX platforms. We can integrate JProfiler with the different IDE, e.g. Eclipse and IntelliJ.

Post Starting of JProfiler,quickstart dialog starts as it contains many shortcuts helps in Profiling of application , with "New Session" tab of start centre Integration wizards & manual configuration dialog are available.

JProfiler

Diagram-Showing Free and Used memory in Telemetry view.

JProfiler

Diagram: Showing which object has highest instance count.

Most of the time would then be spent in the method that keeps the threads waiting while the actual task will only get a small part of the overall time and will be hard to spot. The necessary refinement is done with the concept of thread status. There are 4 different thread statuses in JProfile Runnable Waiting Blocking Net I/O In JProfiler, you can save a snapshot of all current profiling data to disk. It offers a rich comparison facility to see what has changed between two or more snapshots. Alternatively you can create comparison reports programmatically with the command line comparison tool or the comparison ant task. Always a Good Practice to run Profiler on your application in order to access Potential Problem spots during development Process .An awareness for performance & Memory bottlenecks enables to adapt design decisons during project evolution stages , which in turn avoids re-engineering in terms of cost .

Advantages:

  1. It is very simple to use.
  2. Due to extensive views and filtering options, it provides all the information that is required.
  3. Relatively low execution overhead with many profiling options (instrumentation, sampling, etc.) and highly configurable settings.
  4. It displays the live information which helps when you have to stop the analysis to get some results.
  5. User can run the Garbage collector manually to check memory has freed again.
  6. Custom Logic can be entered through JProfiler's built in script editor in JProfiler GUI that includes Custom Probe configuration, Run Interceptor script, Inspections, Heap Walker Filters etc.

References: