104

What can you guys recommend to use with Java?

Only requirement is it should be open source, or has not too expensive academic licence .

Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241

12 Answers12

64

The VisualVM which comes with jdk6 has a basic profiler inside it. VisualVM is provided with the jdk, so if you have the jdk6 installed, you likely have it installed as well.

https://visualvm.github.io/

herrtim
  • 2,697
  • 1
  • 26
  • 36
Chi
  • 22,624
  • 6
  • 36
  • 37
  • 3
    The VisualVM profiler is a stand-alone version of the one in NetBeans. It is a VERY good start. – Thorbjørn Ravn Andersen Jun 04 '09 at 06:06
  • 2
    Definitely download the most updated version on: https://visualvm.dev.java.net/ . Also: this IS the profiler NetBeans uses. – Peterdk Apr 04 '10 at 19:30
  • I've used `VisualVM` before with success, but it was crashing for me while trying to profile a Tomcat app. This worked for me: https://github.com/jvm-profiling-tools/honest-profiler – Lambart Jan 29 '19 at 22:19
  • honest-profiler doesn't work on JVM 11 and the author is not actively working on the project atm. https://github.com/jvm-profiling-tools/honest-profiler/issues/255 – i336_ Mar 28 '21 at 04:14
23

you've got a list here (listing them below, in-case link gets broken)

  • JMemProf
  • JMP
  • DrMem
  • JTreeProfiler
  • NetBeans Profiler
  • JAMon API
  • JBoss Profiler
  • MessAdmin
  • InfraRED
  • TomcatProbe
  • Java Interactive Profiler (JIP)
  • Profiler4j
  • Stopwatch
  • JMeasurement
  • DJProf
  • TIJmp
  • Allmon
  • Appspy
  • EurekaJ
  • japex
  • OKTECH Profiler
  • Perf4j
Bhushan
  • 1,489
  • 3
  • 27
  • 45
LB40
  • 12,041
  • 17
  • 72
  • 107
18

Ah. Netbeans Profiler, developer.com's "Product of the Year" winner, in 2009.

Adeel Ansari
  • 39,541
  • 12
  • 93
  • 133
12

Java has a basic built in profiler called HProf. I find it useful to compare the results it provides with results from more fully features profilers.

tangens
  • 39,095
  • 19
  • 120
  • 139
Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
7

The open-source tool jvmtop does include a basic console profiler. Example output:

 JvmTop 0.7.0 alpha - 15:16:34,  amd64,  8 cpus, Linux 2.6.32-27, load avg 0.41
 http://code.google.com/p/jvmtop

 Profiling PID 24015: org.apache.catalina.startup.Bootstrap

  36.16% (    57.57s) hudson.model.AbstractBuild.calcChangeSet()
  30.36% (    48.33s) hudson.scm.SubversionChangeLogParser.parse()
   7.14% (    11.37s) org.kohsuke.stapler.jelly.JellyClassTearOff.parseScript()
   6.25% (     9.95s) net.sf.json.JSONObject.write()
   3.13% (     4.98s) ....kohsuke.stapler.jelly.CustomTagLibrary.loadJellyScri()
Daniel Ribeiro
  • 3,110
  • 3
  • 23
  • 49
MRalwasser
  • 15,605
  • 15
  • 101
  • 147
4

Eclipse TPTP

Here's an article about Java Application Profiling using TPTP and here's a tutorial Profiling J2SE 5.0 based applications using Eclipse TPTP.

lothar
  • 19,853
  • 5
  • 45
  • 59
  • 3
    I've never been able to set TPTP up. Perhaps I'm too dumb to use it. – quant_dev Nov 01 '09 at 19:00
  • @quant_dev: I have had the same problem but somehow accidently managed to have it set up suddenly (eclipse restarted or whatever?). But when I used it it turned out to be almost useless, was incredibly slow and resource hungry to the point where I had kill eclipse. Some of the more usefull views that were mentioned in several references I found online also don't seem to exist anymore in the current realease that works with eclipse 3.5. So at the moment it's basically just a huge BLOB of uselessness. – x4u Jan 17 '10 at 17:11
  • 1
    Eclipse TPTP looks like a mature product but is extremely slow. I cannot understand why... – Roalt Apr 20 '10 at 12:50
  • 4
    Unfortunately TPTP has now had its final release (v4.7.2). It has been archived and is no longer part of the Eclipse simultaneous release. – joelittlejohn Jun 23 '11 at 22:14
3

Consider cutting-edge https://github.com/jvm-profiling-tools/async-profiler

This project is a low overhead sampling profiler for Java that does not suffer from Safepoint bias problem. It features HotSpot-specific APIs to collect stack traces and to track memory allocations. The profiler works with OpenJDK, Oracle JDK and other Java runtimes based on HotSpot JVM.

It's also built-in into IntelliJ IDEA Ultimate: https://www.jetbrains.com/help/idea/cpu-profiler.html.


There is also similar https://github.com/jvm-profiling-tools/honest-profiler.

The comparison between async-profiler and honest-profiler: https://github.com/jvm-profiling-tools/async-profiler/issues/77

Vadzim
  • 24,954
  • 11
  • 143
  • 151
  • Nice illustrated article on async-profiler: https://hackernoon.com/profiling-java-applications-with-async-profiler-049s2790 – Vadzim Sep 04 '19 at 06:02
3

If you are looking for a no-frills, easy to use open source profiler, you may want to take a look at Jip (Java Interactive Profiler). It's published under a BSD license. I found it to be quite useful for small programs. At least, the results it gives are way more easy to understand than hprofs output.

Martin Dirichs
  • 113
  • 1
  • 11
3

Java Mission Control, it's free to use for development and it integrates with Eclipse. It has very low overhead (<1%) since it piggybacks on the data the JVM is gathering anyway.

It's very easy to use and it can also give a lot information you typically won't find in other profiling tools, e.g. latency profiling, online memory inspection, detailed gc statistics

Kire Haglin
  • 6,569
  • 22
  • 27
2

This is quick, dirty, and very effective: just take a few thread dumps, or pause the program several times, and look at the stack traces.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135
1

JVM Monitor is a Java profiler integrated with Eclipse to monitor CPU, threads and memory usage of Java applications.

If further deep analysis is needed, you may use other tools (e.g. TPTP, Memory Analyzer) as a next step.

Barun
  • 1,520
  • 2
  • 12
  • 18
0

Netbeans IDE includes a free profiler.

Also, if I remember correctly, the academic license for JProfiler is (relatively) inexpensive.

Paul Morie
  • 15,528
  • 9
  • 52
  • 57
  • 1
    OP did ask for "not too expensive academic licence". A single academic licence for JProfiler is US$199 – masher Jun 04 '09 at 04:43
  • 1
    He asked for something that was open source or had an inexpensive academic license. In my opinion, US$199 is fairly inexpensive for a tool that costs $499 for a normal license. – Paul Morie Jun 04 '09 at 04:50