Which Java profiler is better: JProfiler or YourKit? [closed] - java

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Which profiler is better for general purpose profiling and heap analysis? 90% of our apps are standalone command line programs with substantial database and numeric processing. The other 10% are webapps/servlet container apps (with very little JSP and NO SCRIPLETS!). Target user would be Sr Software Engineer with 5-10 years of industry experience. We need support only for Sun JDK 5 and.
As of writing this question (2008-10-02), JProfiler was at 5.1.4 and YourKit was 7.5. Looks like YourKit 8.0 will be released soon.

I've used both JProfiler 4 and YourKit 7.5, and YourKit wins hands down. It's so much less invasive than JProfile, in that I'll happy run production servers with the YourKit agent installed, which I would never do with JProfiler.
Also, the analysis tool that comes with YourKit is more intuitive (in my opinion), making it easier to get the root cause of problems.

If you're on jdk >=1.6_07 you might also want to look at jvisualvm which comes bundled.

Having used both JProfiler and Yourkit recently I find that yourkit is far superior for memory problem analysis and strongly prefer jprofiler for performance analysis. Yourkit's memory analysis seems to be much easier and intuitive. For performance analysis on yourkit I have been unsuccessful in resolving any performance issue I have tried to resolve with yourkit. JProfiler shows more accurate and concise information for performance analysis with the exact number of method invocations and percent time spent in each method. I have yet to find this in yourkit. It seems yourkit just gives sampling information which is not accurate unless you are measuring thousands of invocations.

I've used JProbe, OptimizeIt, and YourKit all extensively and they're all capable tools. Of the 3, my all around favorite is YourKit.
The one killer feature in JProbe is the ability to move from a perf snapshot to annotated source (with counts and timings). I found that to be exceptionally useful.

None of the tools other than JXInsight perform real database transaction analysis:
http://www.jinspired.com/products/jxinsight/concurrency.html
http://www.jinspired.com/products/jxinsight/olapvsoltp.html
JXInsight's Probes technology is also the only one that could even run in production considering that we out perform netbeans profiler by 20x and yourkit 100x in SPECjvm2008 benchmarks.
http://blog.jinspired.com/?p=272
I am the architect of JXInsight so of course I am completely biased but at the same time I am probably more qualified than most in the Java industry to make such a claim since I have devoted the last 8 years to performance analysis for some of the most demanding of Java/J2EE application in production.
I should be point out that JXInsight is designed for software performance engineers and not just for the occasional adhoc profiling session. We have more than 4000+ system properties to configure the runtime and 600+ technology extensions libraries so it might be overkill unless one has a complex problem to solve and/or using the same tool across development, test and production is paramount.
Kind regards,
William

With Java 7 Update 40, Oracle included Java mission control (originally part of the JRockit JDK) - a very powerful performance tuning tool which is able to compete with yourkit/jprofiler.
Take a look and be surprised.

I have used both and my vote now is definitely JProfiler (in the current version 6) as it is easier to use and has a lot of useful additional features. In previous releases YourKit had some advantages with larger snaphots, but this is gone now.

Definitely YourKit ... It was able to open 4 gigs heap dump with just 1g of heap used. While Jprofiler with same heap allocation crashed!

i've used yourkit and it is a very nice profiler, the best i've ever used in java (i've used a variety of others over the years). that being said, i've never used jprofiler, so i can't give a direct comparison.

For quick and dirty profiling of command-line programs, JIP works really well.

Been using JProfiler for years and very happy with it. IntelliJ seems to switch their recommendation back and forth between YourKit and JProfiler so I would guess their feature sets are similar. I believe they both have trial version.

DISCLAIMER : Alternate answer.
they have various products for production monitoring/profiling UNLIKE other mostly development time tools : http://www.jinspired.com/products/jxinsight/
This post on theserverside on JDBInsight : http://www.theserverside.com/news/thread.tss?thread_id=13488
DISCLAIMER : I am NOT associated with this company at any level.

I have used YourKit. I have not used JProfiler. I have used OptimizeIt before. I have very good opinion about YourKit. It is very stable and good GUI and good feature list. One unique feature I have noticed is CPU profiling with and without wait time (like I/O wais) including.
It is priced also very reasonably (about about $1100 for 5 licenses I think)

YourKit is great. You might also want to check out the profiler built into NetBeans--it's pretty cool.

Yourkit
It's low overhead, stable, easy to install on the JVM to be profiled (just one dll) and powerful.
For analyzing heap dumps it's the only profiler that comes close to the Eclipse Memory Analyzer.

I've only used JProfiler (and some JProbe). As far as I can tell, one limitation of YourKit is that they don't appear to support JDK 1.4.2. That's not an issue for many people, but it might be.

+1 for yourkit --- using 7.0 on dev boxes in windows
not used JProfiler for a while -- cannot comment since they might have improved in the meantime.

Just as an aside, you may want to consider the Netbeans profiler -- it's pretty good. But I've not used either of the two you mentioned.

I am using JProfiler and find it overall OK. It's "dynamical instrumentation" feature is terribly biased for small methods, though.

I am using the TPTP profiler. the best feature it has that this can be integrated very easily in Eclipse but the bad thing is that it makes the Eclipse run slower.

Definitly YourKit. It is the most intuitiv and stable!

Related

Best and safest Java Profiler for production use? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm looking for a Java Profiler for use in a very high demand production environment, either commercial or free, that meets all of the following requirements:
Lightweight integration with code (no recompile with special options, no code hooks, etc). Dropping some profiler specific .jars alongside the application code is ok.
Should be able to connect/disconnect to the JVM without restarting the application.
When profiling is not active, no impact to performance
When profiling is active, negligible impact to performance. Very slight degradation is acceptable.
Must do all the 'expected' stuff a profiler does - time spent in each method to find hotspots, object allocation/memory profiling, etc.
Essentially I need something that can sit dormant in production when everything is fine without anyone knowing or caring that it is there, but then be able to connect to it hassle (and performance degradation) free to pinpoint the hard to find problems like hotspots and synchronization issues.
Have you tried YourKit? It has almost all of the features you are looking for.
Java VisualVM is a tool that provides a visual interface for viewing detailed information about Java technology-based applications (Java applications) while they are running on a Java Virtual Machine (JVM). Java VisualVM organizes JVM data that is retrieved by the Java Development Kit (JDK) tools and presents the information in a way that enables you to quickly view data on multiple Java applications. You can view data on local applications and applications that are running on remote hosts. You can also capture data about the JVM software and save the data to your local system, and view the data later or share the data with others. This comes with Oracle JDK it self...
$ jvisualvm
I have been happy with jProfiler.
I prefer Java Flight Recorder. It causes almost no performance overhead and has a nice GUI. Add JVM parameters
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder
-XX:StartFlightRecording=name=test,filename=test.jfr,dumponexit=true
and open the record with JMC.
Checkout CA Wily.
http://www.ca.com/us/application-management.aspx
I use Eclipse TPTP - Eclipse Test & Performance Tools Platform Project. Whether it is suitable for production use or not, it depends on the user. For me, it's fine and it does meet your needs.
http://www.eclipse.org/tptp/
Another option is http://www.newrelic.com/. We have been using it in production for some time, and it seems to be pretty reliable and performant. Simple to setup (one .jar and a -agent commandline option).
There's another new option called javosize
When I looked for "best java profiler" on google, I saw on the first non-paid link (it's a blog), the same tool on the comments to the post:
https://blog.oio.de/2014/03/07/java-profilers-a-short-comparison-between-jprofiler-yourkit-and-javas-visualvm/
Hope it helps!
Edit: As comments say, linkedin link is to a private forum. Sorry for it. Here is the link to main site:
http://www.javosize.com/gettingStarted.html
FusionReactor Java Application Performance Monitor, also includes a very low overhead Java Profiler as part of its feature portfolio.
http://www.fusion-reactor.com/production-java-profiler/
FusionReactor can be installed in a couple of minutes & they have a free 14 day trial to test it out.
Take a look at Java Mission Control in conjunction with Flight Recorder. Starting with the release of Oracle JDK 7 Update 40 (7u40), Java Mission Control is bundled with the HotSpot JVM, so it is highly integrated and purports to have small effects on run-time performance. It has call tree functionality like Callgrind.

How to measure performance in Java developement

Is there any tool can measure execution time for each function call and find out bottle neck for a given developing java j2se project? Thanks!
Use profiling tools, such as YourKit, JProfiler and HPROF (this one is a command line tool).
You are looking for a profiler. I know that NetBeans includes a decent one.
You can also look at this question: Open Source Java Profilers.
It seems that the JDK 1.6 comes with a basic profiler. So maybe you want to give it a try first.It should be included with the VisualVM that comes with your jdk6: visualvm profiler
Yes, there are lot of tools - profiles like Netbeans Profiler or eclipse equivalent. Look at this course of JavaPassion to find out more about profiling tools and performance of Java applications.
Look at also this SO question to find out open source java profiles.
Consider the most precise and non-intrusive async-profiler.
IntelliJ IDEA Ultimate has built-in profilers support:
https://www.jetbrains.com/help/idea/cpu-profiler.html
You might try aspect oriented programming to intercept every method call and compute the duration.
Measuring is fine, but is a very indirect way to find bottlenecks. A very direct way is this: just hit ctrl-break several times, and examine the thread stacks.
Any bottleneck will be a line of code, nearly always a function call, and it will appear often on the stack of some thread. The worse it is, the more often it will appear.
Just look for any such often-appearing line of code. If you can figure out how to call it less, or not at all, you will save a bundle of time, guaranteed. Here's why.
Java JDK comes with JVisualVM under bin folder, once your application server (for example is running) you can run visualvm and connect it to your localhost, which will provide you memory allocation and enable you to perform heap dump
For more detailed steps on how to enable: http://sysdotoutdotprint.com/index.php/2017/08/01/turn-profiler-java/

Open Source Java Profilers [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
What can you guys recommend to use with Java?
Only requirement is it should be open source, or has not too expensive academic licence .
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/
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
Ah. Netbeans Profiler, developer.com's "Product of the Year" winner, in 2009.
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.
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()
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.
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.
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
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.
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
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.
Netbeans IDE includes a free profiler.
Also, if I remember correctly, the academic license for JProfiler is (relatively) inexpensive.

If you have a Java application that is consuming CPU when it isn't doing anything, how do you determine what it is doing?

I am calling a vendor's Java API, and on some servers it appears that the JVM goes into a low priority polling loop after logging into the API (CPU at 100% usage). The same app on other servers does not exhibit this behavior. This happens on WebSphere and Tomcat. The environment is tricky to set up so it is difficult to try to do something like profiling within Eclipse.
Is there a way to profile (or some other method of inspecting) an existing Java app running in Tomcat to find out what methods are being executed while it's in this spinwait kind of state? The app is only executing one method when it gets in this state (vendor's method). Vendor can't replicate the behavior (of course).
Update:
Using JConsole I was able to determine who was running and what they were doing. It took me a few hours to then figure out why it was doing it. The problem ended up being that the vendor's API jar that was being used did not match exactly to the the database configuration that it was using. It was defaulting to having tracing and performance monitoring enabled on the servers that had the slight mis-match in configuration. I used a different jar and all is well.
So thanks, Joshua, for your answer. JConsole was extremely easy to setup and use to monitor an existing application.
#Cringe - I did some experimenting with some of the options you suggested. I had some problems with getting JProfiler set up, it looks good (but pricey). Going forward I went ahead and added the Eclipse Profiler plugin and I'll be looking over the different open source profilers to compare functionality.
If you are using Java 5 or later, you can connect to your application using jconsole to view all running threads. jstack also will do a stack dump. I think this should still work even inside a container like Tomcat.
Both of these tools are included with JDK5 and later (I assume the process needs to be at least Java 5, though I could be wrong)
Update:
It's also worth noting that starting with JDK 1.6 update 7 there is now a bundled profiler called VisualVM which can be launched with 'jvisualvm'. It looks like it is a java.net project, so additional info may be available at that page. I haven't used this yet but it looks useful for more serious analysis.
Hope that helps
Facing the same problem I used YourKit profiler. It's loader doesn't activate unless you actually connect to it (though it does open a port to listen for connections). The profiler itself has a nice "get amount of time spent in each method" while working in it's less obtrusive mode.
Another way is to detect CPU load (via JNI, so you'd need an external library for this) in a "watchdog" thread with highest priority and start logging all threads when the CPU is high enough for a long enough time. You might find this article enlightining.
If it's for professional purpose and you have some money to spend, try to get your hands on JProfiler. If you just want to get some insights, try out the Eclipse Profiler Plugin. I used it several times, but I don't know the current state.
A new(?) project from the eclipse project itself is available too: http://www.eclipse.org/tptp/ (See this article). Never used it, so I can't tell if it is worth the effort.
There's also a very good list of open source profilers available at http://www.manageability.org/blog/stuff/open-source-profilers-for-java
If JConsole can't be used you can
press CTRL+BREAK under Windows
send kill -3 <process id> under Linux
to get a full Thread Dump. This doesn't affect performance and can always be run in production.
JRockit Mission Control Latency Analyzer.
The Latency Analyzer that comes with JRockit shows you what the JVM is "doing" when it's not doing anything. In the latest version you can see latencies for:
Java wait/blocked/sleep/parked.
File I/O
Network I/O
Memory allocation
GC pauses
JVM latencies, e.g code generation and class loading
Thread suspension
The tool will give you the stack trace when the latency occurred. You can view the latency data in many different ways (aggregated traces, as a histogram, in a thread graph etc.). The tool also allows you to see transitions between threads, for instance when one thread notifies another.
latency analyzer http://blogs.oracle.com/hirt/WindowsLiveWriter/The.0LatencyAnalyserMigratedfromtheoldBE_7246/latency_graph_2.png
The overhead is negligible and unlike many other tools it can be used in a production environment.
This blog post gives you a brief introduction and the program can be downloaded here.
It's free to use for development!
Use a profiler. Yes they cost money, and using them can occasionally be a bit awkward, but they do provide you with a great deal more real evidence rather than guesswork.
Human beings are universally bad at guessing where performance bottlenecks are. It just seems to be something our brains aren't build to do very well. It may seem obvious, you may have great ideas about what the problem is, but the real world often turns out to be doing something different. And optimising the wrong part of code means, at best, lots of work for minimal benefit. More often it makes things slower, and sometimes it breaks things entirely. So before you make any changes for the sake of optimisation, you should always have real evidence from a profiler or other accurate tool.
As mentioned, both JProfiler and YourKit are both fairly good and not prohibitively expensive. Last time I looked, they both had free demos too.
For completeness sake: even though my company more or less standardizes on Eclipse we use Netbeans (6 and up) with its included, free profiler on a daily basis. It works better than the Eclipse TPTP plugin (last checked 3 months ago) and for us it removes any need for a commercial profiler such as JProfiler, which is excellent, but fast becoming unnecessary.
VisualVM should be the profiler from netbeans as standalone. I tried the TPTP for eclipse but visualVm seems as a much nicer option!

How to test java application for performance bottlenecks?

I am reviewing a big java application to see if there are any performance bottlenecks. The real problem is that I cannot pinpoint the performance issues to any single module. The whole application is slow as such.
Is there some tool/technique I can use to help me out in this?
Try using a profiler on your running code. It should help you identify the bottlenecks. Try jprofiler or Netbeans profiler
I'm often happy enough using Java -Xprof. This gives you a sorted list of the functions your code spends most of its time in.
If you are running on Java 6 you can use the supplied monitoring tools
For testing/development purposes, you can download Oracle JRockit Mission Control for free from this site. (Requires Login, but accounts can be set up with any email adress)
Docs Here. It will allow you to find hotspots, memory leaks and much more.
As we see from How can I profile C++ code running in Linux?, the most statistically significant approach is to use a stack profiler.
Well, Java runs in the JVM, so getting a stack useful for C code won't be useful for us (it'll get the JVM stuff, not your code). Fortunately, Java has jstack! http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jstack.html
It'll give you a bunch of threads, like the GarbageCollector. Don't worry about those, just look at where your threads are.
YourKit is a excelent java profiler (not free).

Categories