Google Answers Logo
View Question
 
Q: profiling Java program ( No Answer,   2 Comments )
Question  
Subject: profiling Java program
Category: Computers > Programming
Asked by: phish-ga
List Price: $2.00
Posted: 01 Jun 2003 21:10 PDT
Expires: 09 Jun 2003 20:47 PDT
Question ID: 211811
I need to profile the performance of a Java program I've written. I'm
working in Unix. Can you suggest a good profiler for finding
bottlenecks, estimating throughput, etc? It needs to be relatively
straightforward to install and learn to use, as I'm in a hurry.

Request for Question Clarification by maniac-ga on 02 Jun 2003 04:47 PDT
Hello Phish,

I could recommend jprof, but if your Unix is not Solaris, there is no
pre built binary available and the source code is "not complete" for
other Unix systems. If this meets your needs, check out
  http://starship.python.net/crew/garyp/jProf.html
or
  http://starship.python.net/crew/garyp/jProf_JumpStart.html
for more details.

There are commercial products available, but based on the cost of the
question compared with the cost of those tools, I ruled those out.

If this helps, please let me know so I can prepare a proper answer. If
not, please add some information about your situation so another
researcher or myself could follow up.
  --Maniac
Answer  
There is no answer at this time.

Comments  
Subject: Re: profiling Java program
From: poormattie-ga on 02 Jun 2003 09:07 PDT
 
I recommend Compuware's DevPartner Java Edition. I develop for their
NuMega lab where it's made, and am quite impressed by it:

http://www.compuware.com/products/devpartner/java.htm
Subject: Re: profiling Java program
From: berthengron-ga on 03 Jun 2003 07:33 PDT
 
Simple, but very easy to install - there is a built in profiler, start
java with -Xrunhprof
Hprof usage: -Xrunhprof[:help]|[<option>=<value>, ...]

Option Name and Value  Description                Default
---------------------  ----------------------     -------
heap=dump|sites|all    heap profiling             all
cpu=samples|times|old  CPU usage                  off
monitor=y|n            monitor contention         n
format=a|b             ascii or binary output     a
file=<file>            write data to file         java.hprof(.txt for
ascii)
net=<host>:<port>      send data over a socket    write to file
depth=<size>           stack trace depth          4
cutoff=<value>         output cutoff point        0.0001
lineno=y|n             line number in traces?     y
thread=y|n             thread in traces?          n
doe=y|n                dump on exit?              y
gc_okay=y|n            GC okay during sampling    y

Example: java -Xrunhprof:cpu=samples,file=log.txt,depth=3 FooClass

Good enough for finding bottlenecks

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy