Ropardo Sowftware development company

Experience software development with ROPARDO S.R.L.

RSS Feed
RSS Feed
  • Home
  • About ROPARDO S.R.L
  • Our websites

Analyzing an application with JProfiler Tool

JProfiler is a modern and very useful Java tool for analyzing data. It’s dedicated to analyze J2EE, J2SE projects, and can integrate a number of IDE. An equivalent profiler for NetBeans is Jfluid Technology.

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.

Current version is 6.0.3 and can be used as a free trial for a determined amount of time.
JProfiler offers a lot of features for an analyst/tester/programmer such as: can detect out the memory overflow,
memory leaks,show the count and size of variables from the application etc.

By default the tool does not track the creation of all objects, thus the count of them is updated as the application is used. It can also keep statistics on Garbage Collected(GC) objects and in the view can be chosen to see only live objects or GC objects or both .
For the non recorded objects, JProfiler does not know about the class name and so, the monitor views and graphs are influenced.

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. See picture below:

Click to Enlarge

One of the interesting features of JProfiler is the “Heal Walker->References”.  In the documentation of the tool it says “Here you can find out how single objects are referenced and why they’re not garbage collected.” Choosing an object from the (for eg) Classes tab, double clicking on the one you are interested to analyze more and a new object will be created for this. This object will contain all the allocation spots in the current object set. Now, in the References tab you are offered the option to search for paths to the GC roots. You can choose to show in the view a single root, a specified number of roots or all of them. See picture below:

Click to Enlarge

Anywhere in the shown chain can be looked for a potential memory leak.

CPU Profiling:

This type of analyze is very important. We want everything to run faster better and to use as less as possible from any type of resource.
I found this small article about CPU profiling that is used at Google(http://goog-perftools.sourceforge.net/doc/cpu_profiler.html).
Back to CPU profiling using JProfiler (the CPU usage is disabled by default) :)
An important feature is the wall clock time, which is the duration between the start and end of a method measured in time with a clock. Take in account that this timer is not actually the time spent by the CPU on the method. The Operating System Scheduler , the documentation states, can interrupt the execution of a method as many times as it wants and perform other tasks.

This made me wonder on how accurate is this, or how can you trust the end result of timing, but reading some more about it I found out that the actual time on the method is called CPU time.  So there can be differences between CPU time and walk clock time, and remember to read the CPU time. To “enable” the CPU time(the wall clock is default) you have to edit the Profiling Settings and change the Measurement type. See picture below:

Click to Enlarge

Not tested but documented, it seems that Operation Systems offer different timers with difference performance rate. “For example, on Microsoft Windows, the standard timer with a granularity of 10 milliseconds is very fast, because the operating system “caches” the current time. However, the duration of method calls can be as low as a few nanoseconds, so a high resolution timer is needed. A high resolution timer works directly with a special hardware device and carries a noticeable performance overhead.”

References:

- JProfiler official website

Tags: CPU Profiling Java JProfiler

 Posted in: Java
April 1, 2010 | Gabriela Radu | 5 Comments

5 Responses

  • Abder-Rahman
    April 5, 2010
    1

    I think you meant to say: “Analyzing” INSTEAD OF “Analizing”?

  • Ciprian Radu
    April 15, 2010
    2

    Hi,

    I wasn’t aware about the CPU profiling feature of JProfiler. I find it very important as well. I don’t think that I have understood very well what you have explained. Let me state first what I’ understood and then I will have a question.

    Wall clock time = the actual time a CPU needs to complete a task (this is the meaning in Computer Science to the best of my knowledge; note that this definition subtly involves extra time, besides the time needed to only execute a piece of code)

    By looking to your screenshot from JProfiler, I can say that: elapsed time = wall (clock) time (I prefer wall time instead of wall clock time; I think it’s more clear this way). It cannot be a “clock time” but only “actual time” (stop time – start time) because, as you have mentioned (and it is also obvious) things like I/O time, waiting for resources, context switches etc. are also measured (and I don’t think this can be avoided without hardware support).

    What about “Estimated CPU time”? (don’t get me wrong but, Elapsed time is a very simple metric :) ) Do you have any idea on how JProfiler tries to estimate the CPU time? I would be interested on how you can achieve such a thing by software means (is JProfiler written in Java, C/C++ or ?) and maybe you already know something about this.

  • wholesale sunglasses
    July 29, 2010
    3

    Thanks for best news!

  • Wholesale shoes
    July 30, 2010
    4

    thanks for great informations It’s a wonderful

  • jerseys
    September 16, 2010
    5

    Thanks for posting! I really enjoyed the report. I’ve already bookmark

    this article.


  • « Previous post
  • Next post »
  • Recent Posts

    • How to put online the Apache 2.4 Server
    • Exit from an Android application
    • Showing keyboard automatically in Android dialogs
    • Request Elevated Privileges in Windows Vista and 7 where UAC is enabled
    • Checkboxes unchecked value
  • Ropardo is Hiring

  • Subscribe

    • Add to Google Reader or Homepage Add to netvibes TopOfBlogs
  • Recent Comments

    • Laurent on GWT 2.1 – Uploading a file using the RPC mechanism
    • ketone review on GWT/GXT – File Upload
    • Seris on Multiple select ComboBox in RadGrid filter
    • Mihai Ionescu on Basic file encryption with PHP mcrypt using cryptastic class
    • Furqon on Basic file encryption with PHP mcrypt using cryptastic class
  • Archives

    • September 2012 (1)
    • August 2012 (2)
    • June 2012 (1)
    • March 2012 (1)
    • February 2012 (1)
    • November 2011 (1)
    • September 2011 (4)
    • July 2011 (3)
    • June 2011 (2)
    • May 2011 (4)
    • April 2011 (4)
    • March 2011 (3)
    • February 2011 (2)
    • January 2011 (2)
    • December 2010 (1)
    • November 2010 (4)
    • October 2010 (4)
    • August 2010 (3)
    • July 2010 (3)
    • June 2010 (6)
    • May 2010 (8)
    • April 2010 (7)
    • March 2010 (9)
    • February 2010 (6)
    • January 2010 (5)
    • December 2009 (7)
    • November 2009 (9)
    • October 2009 (10)
    • September 2009 (14)
    • August 2009 (10)
    • July 2009 (1)
    • June 2009 (1)
    • May 2009 (1)
    • April 2009 (1)
    • March 2009 (1)
    • October 2008 (3)
    • October 2007 (3)
    • July 2007 (4)
    • June 2007 (1)
    • May 2007 (3)
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Categories

    • News (16)
    • Ropardo Team (8)
    • Ropardo Products (6)
      • File Tracking Client (4)
      • iManagement (2)
    • Software Development (86)
      • Microsoft.NET (23)
      • Java (43)
      • Oracle (8)
      • Power Builder (3)
      • Liferay (5)
      • Lotus Notes (9)
      • xWiki (4)
    • System Adminstration (13)
      • Linux (10)
      • Windows (3)
    • Programming (4)
    • Uncategorized (3)
    • Databases (10)
      • MSSQL (5)
      • PostgreeSQL (3)
    • Microsoft.NET (2)
    • Web Development (30)
      • ASP/ASPX (3)
      • Content Management Systems (1)
      • HTML/CSS (6)
      • Javascrip/AJAX (8)
      • PHP (8)
    • Oracle E Business Suite (6)
  • Tags

    .NET ajax blog C# certification client CMS control css database Debugging django Domino Eclipse extension file tracking filter fun gentoo google Hibernate how to html image iManagement import Java javascript jQuery liferay Linux Lotus Notes lotus script Oracle Oracle BI Publisher 11g PHP portal PostgreSQL powerbuilder Python SQL Telerik velocity xml Xwiki

© 2013 ROPARDO s.r.l..

Powered by WordPress. Styled by Ropardo