What profilers are you using?

328 views
Skip to first unread message

Sergio

unread,
Feb 5, 2009, 10:47:17 PM2/5/09
to Clojure
I have been trying out the YourKit profiler and I think it's great.
However, my evaluation license is going to expire soon and being a
student I can't purchase (even the academic) license right now.

I have tried profiler4j and it is usable but it isn't working 100%
right with clojure (in my case). Jrat (http://jrat.sourceforge.net/)
seems promising as well as JIP (http://jiprof.sourceforge.net/) (the
fact that it outputs text means that there could be easy integration
with Emacs with some Elisp code), but I haven't tried them yet.
Nothing I have checked out seems as nice as YourKit, although those
two I mentioned appear to get close.
Again, I haven't tried them. I am going to, and they would probably
meet my needs perfectly, but still.. If anyone knows of something
better or has any recommendations/opinions they could share, please
do. Thanks!

Mark McGranaghan

unread,
Feb 6, 2009, 7:44:58 AM2/6/09
to clo...@googlegroups.com
You can use the Early Access version of YourKit: it does not require a
license key and in my experience works great:

http://www.yourkit.com/eap/index.jsp

- Mark

Peter Wolf

unread,
Feb 6, 2009, 8:50:38 AM2/6/09
to clo...@googlegroups.com
Hi Sergio,

I have been using JProfiler with the IntelliJ Clojure plugin. The
combination seems to work fine, except that JProfiler does not know how
to display Clojure source code associated with a function. However,
there is enough information displayed that you can do it trivially.

Peter

Vincent Foley

unread,
Feb 6, 2009, 10:17:42 AM2/6/09
to Clojure
I don't know much about Java profiling, but I've been using java -
Xprof and java -Xrunhprof, and it's usually been enough to guide me.

Jason Wolfe

unread,
Feb 6, 2009, 12:57:20 PM2/6/09
to Clojure
+1 for the EAP of YourKit. It will expire every now and then, but you
just download the new version.

The only problem I have is that as far as I can figure out, it can't
display source code associated with a function either. This is
usually fine, except for that it can be impossible to figure out which
anonymous function is which, and even worse, it seems that the Clojure
compiler currently names methods like anonymous functions (so you
can't tell which method name, let alone instance, is actually being
called). I plan on trying to implement / ask for more descriptive
method and anonymous function names (e.g., including line numbers) at
some point.

-Jason

On Feb 6, 4:44 am, Mark McGranaghan <mmcgr...@gmail.com> wrote:
> You can use the Early Access version of YourKit: it does not require a
> license key and in my experience works great:
>
> http://www.yourkit.com/eap/index.jsp
>
> - Mark
>

Sergio

unread,
Feb 6, 2009, 3:06:09 PM2/6/09
to Clojure
Thanks! I hadn't seen the EAP option =) I'm going to go with that.

David Powell

unread,
Feb 7, 2009, 9:16:21 AM2/7/09
to Clojure

Newer versions of JDK 1.6, eg Update 11, have an application called
'jvisualvm' in the bin directory. It lets you attach to any running
Java process and it has a profiler that you can switch on at runtime.

It seems quite good. It does profiling via instrumentation, and yet
doesn't slow the app down to much. I tried it with a clojure module
that is run from a Java appserver, and it worked well.


--
Dave


Allen Rohner

unread,
Mar 10, 2009, 11:04:45 PM3/10/09
to Clojure


On Feb 7, 9:16 am, David Powell <djpow...@djpowell.net> wrote:
> Newer versions of JDK 1.6, eg Update 11, have an application called
> 'jvisualvm' in the bin directory. It lets you attach to any running
> Java process and it has aprofilerthat you can switch on at runtime.
>
> It seems quite good. It does profiling via instrumentation, and yet
> doesn't slow the app down to much. I tried it with a clojure module
> that is run from a Java appserver, and it worked well.
>
> --
> Dave

Can you go into more detail about how you used visualvm? I'm trying to
run it (visualvm 1.1.1), and it seems to have a race condition with
the clojure classloader. Sometimes it won't find all of the compiled
clojure source, and sometimes it will correctly profile methods until
I reload a file, at which point the profiler no longer tracks calls to
the clojure fn.

Any advice?

Allen

Allen Rohner

unread,
Mar 10, 2009, 11:41:08 PM3/10/09
to Clojure


> Can you go into more detail about how you used visualvm? I'm trying to
> run it (visualvm 1.1.1), and it seems to have a race condition with
> the clojure classloader. Sometimes it won't find all of the compiled
> clojure source, and sometimes it will correctly profile methods until
> I reload a file, at which point theprofilerno longer tracks calls to
> the clojure fn.
>

Replying to my own question because I figured it out. On the profiler
tab, before you hit "start profiling", click the settings checkbox.
Edit the "start from class" field. Mine was set to jline.**. After
changing it to the appropriate namespace for my app, hit the "start
profiling" button. Visualvm starting working reliably for me after
that.

Allen

pmf

unread,
Mar 11, 2009, 12:44:40 PM3/11/09
to Clojure
On Mar 11, 4:41 am, Allen Rohner <aroh...@gmail.com> wrote:
> Replying to my own question because I figured it out. On the profiler
> tab, before you hit "start profiling", click the settings checkbox.
> Edit the "start from class" field. Mine was set to jline.**. After
> changing it to the appropriate namespace for my app, hit the "start
> profiling" button. Visualvm starting working reliably for me after
> that.

Thanks, this works really nice. I tried in vain to get Netbean's
profiler to work with Clojure, but I'll think I'll stick to jvisualvm
now.

Allen Rohner

unread,
Mar 11, 2009, 2:15:03 PM3/11/09
to Clojure
Just FYI, I am using the standalone download of visualvm from
https://visualvm.dev.java.net/, because I couldn't find visualvm in
the Apple 1.6 JDK

Allen

Scott Jaderholm

unread,
Mar 12, 2009, 12:47:42 PM3/12/09
to clo...@googlegroups.com
On Sat, Feb 7, 2009 at 8:16 AM, David Powell <djpo...@djpowell.net> wrote:

Newer versions of JDK 1.6, eg Update 11, have an application called
'jvisualvm' in the bin directory. It lets you attach to any running
Java process and it has a profiler that you can switch on at runtime.

If you're starting Clojure from inside Emacs under Windows then you might have trouble connecting to it with VisualVM. Start Clojure from outside emacs, connect to it using slime, and VisualVM should work fine.

Sergio

unread,
Mar 12, 2009, 9:51:45 PM3/12/09
to Clojure
I don't have trouble connecting from Emacs. I just added
(setq swank-clojure-extra-vm-args (list "-
Dcom.sun.management.jmxremote=true" )
to my clojure swank configuration.

On Mar 12, 10:47 am, Scott Jaderholm <jaderh...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages