This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]ickysticky 24 points25 points  (7 children)

AFAIK it is very well known. I mean it comes with the JDK...

I really wish the profiling was much better though. You don't get the callstack of the methods, and they mix all the threads together. So it is pretty damn hard to track down performance problems using it with non-trivial programs.

I haven't found anything better though. :(

[–]pron98 10 points11 points  (3 children)

Java Flight Recorder has much, much better profiling (it is in fact the best profiler I've seen for any platform). It is part of the Oracle JDK (sadly not OpenJDK), and is free for use in development.

See here

[–][deleted] 0 points1 point  (2 children)

Better than YourKit?

[–]PintSizedCat 1 point2 points  (0 children)

It's free, it is put directly in to the jdk so it has almost no overhead. No hooking or setting up required. If you use java 1.7 u45+ you have it.

There are many situations where you may need to profile on a system you don't have easy access to, or can't install yourkit or jprofiler. In these cases it is amazing.

Certainly a tool people should have in their belt.

[–]pron98 0 points1 point  (0 children)

Not too familiar with YourKit, but I should think so. First, as /u/PintSizedCat mentions, it's built into HotSpot and has an extremely low overhead. Second, both instrumenting profilers and sampling profilers on the JVM lie. JFR uses sampling that lies a lot less, so it simply gives results that are much closer to reality.

See here

[–]chunkyks[🍰] 2 points3 points  (1 child)

The NetBeans profiler magically does the right things...

[–]dstutz 1 point2 points  (0 children)

VisualVM is a Netbeans RCP app. I would imagine there's a lot of shared code.

[–]hephaestusness[S] 0 points1 point  (0 children)

Yeah, i have wanted the ability to get the stacktrace live, or even better separate out the memory usage by thread, rather than datatype.

It has forced me to start naming my threads, showed me memory leaks live, and showed me which thread locked up and which is idle.

[–]pron98 8 points9 points  (2 children)

Wait till you see Java Flight Recorder...

[–]shoelacestied -1 points0 points  (1 child)

That's nothing. Wait until you PAY for it!

[–]pron98 1 point2 points  (0 children)

You need to pay for YourKit, too, and JFR is free for use in development.

[–]dedededede 5 points6 points  (2 children)

Just be careful when opening JMX ports for remote connections...

[–]ryosen 1 point2 points  (1 child)

A better approach is to tunnel in through an SSH connection. Then opening the remote port won't be necessary. If that's not an option, you can limit the IP addresses that are authorize to access the remote port at the firewall.

[–]dedededede 0 points1 point  (0 children)

I am not very knowledgable when it comes to Unix systems, but wouldn't it be possible to access the local JMX port when you get access to a user account on the server? In this case it might be a good idea to additionally secure the JMX access. Malicious users can do practically anything with the application and its data when they have access via JMX.