There's one built into java, use java -hprof.  It'll do CPU, but not memory.
Check out this article:
http://developer.java.sun.com/developer/technicalArticles//Programming/perfanal/index.html

"Mike Bresnahan" <mike at fruitioninc.com> writes:

> Download a eval copy of Rational Quantify and profile your code.
> 
> Hey, do you know of any opensource profilers - cpu and/or memory?  That
> would be a cool project.
> 
> Mike
> ----- Original Message -----
> From: "Bob Tanner" <tanner at real-time.com>
> To: <tclug-devel at mn-linux.org>
> Sent: Tuesday, July 10, 2001 12:04 AM
> Subject: [TCLUG-DEVEL] JCE dog slow?
> 
> 
> > Is my code just crap, or is the JCE slow?
> >
> > Doing -single- DES on a 140 byte array is taking an avg of 4 sec!
> >
> > Triple DES is off the scale.
> >
> > It's almost unusable.
> >
> > --
> > Bob Tanner <tanner at real-time.com>       | Phone : (952)943-8700
> > http://www.mn-linux.org                 | Fax   : (952)943-8500
> > Key fingerprint =  6C E9 51 4F D5 3E 4C 66 62 A9 10 E5 35 85 39 D9
> >
> > _______________________________________________
> > tclug-devel mailing list
> > tclug-devel at mn-linux.org
> > https://mailman.mn-linux.org/mailman/listinfo/tclug-devel
> 
> _______________________________________________
> tclug-devel mailing list
> tclug-devel at mn-linux.org
> https://mailman.mn-linux.org/mailman/listinfo/tclug-devel

-- 
Jon Schewe | http://mtu.net/~jpschewe | jpschewe at mtu.net
For I am convinced that neither death nor life, neither angels 
nor demons, neither the present nor the future, nor any 
powers, neither height nor depth, nor anything else in all 
creation, will be able to separate us from the love of God that 
is in Christ Jesus our Lord. - Romans 8:38-39