Solved

profiler for performance measurement- java multithreading

Posted on 2012-03-14
6
269 Views
Last Modified: 2012-03-24
hi guys

I am using executor service in my code. Is there a profiler i can use to check what the threads are doing and how much time it takes to finish the task.

Right now i am using System.currentTimeMillis() to calculate the time taken but its inaccurate

long exportStartTime= System.currentTimeMillis();                  
 ExecutorService executor = Executors.newFixedThreadPool(3);                        
 final HSSFWorkbook runnableWb = wb;
 Runnable expTask = new Runnable(){        
 public void run(){        
 getExportDocumentObject(true, "Excel",buffer, mReq,runnableWb);
 }
long exportEndTime= System.currentTimeMillis();                  
System.out.println("Time taken for task (VERY INACCURATE):" + exportEndTime-exportStartTime);


Are there any open source profilers which can tell me which thread is doing what and how much time it takes complete the task?

thanks
0
Comment
Question by:royjayd
  • 3
  • 3
6 Comments
 
LVL 12

Expert Comment

by:Sharon Seth
ID: 37723629
Netbeans has got some very good profilers which work very well on profiling threads .

There is another profiler TPTP  which can be plugged into Eclipse. - Did not try this yet
I beleieve JDK 6 or 7 comes with some profilers by default.

I once saw profiling thru NetBeans at a Java conference . I suggest you try it first
0
 

Author Comment

by:royjayd
ID: 37724457
I use eclipse, not sure I want to move to netbeans. Are there a which any commercial ones which are good?

Thx.
0
 
LVL 12

Expert Comment

by:Sharon Seth
ID: 37724486
Jprofiler
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

Author Comment

by:royjayd
ID: 37724954
Does jprofiler give thread by thread information? Like which thread is doing what?
0
 
LVL 12

Accepted Solution

by:
Sharon Seth earned 300 total points
ID: 37725142
Ofcourse , it does  . It's commercial , has much more features
0
 

Author Comment

by:royjayd
ID: 37732830
heard lot of good things about Yourkit. Downloaded the trial. Fantastic tool.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mockito example issue 8 72
simple java question 3 56
print map entry 34 69
Way to decrease size of apk file 9 67
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question