tags:

views:

56

answers:

3

I'm looking for a profiler than can profile a Java6 application running on a separate linux box (with no windows manager).

The application is a latency sensitive, multithreaded server that typically responds to incoming network events in several hundred microseconds (less than 1 millisecond). I'm interested in learning about hot sections of code and contended locks, I'm less interested in memory usage patterns.

I'm not concerned about the profiling overhead during the profiling run, I expect there to be a performance hit.

A: 

Checkout NetBeans Profiler. Suggesting it as no one else has suggested same. This one looks more feature rich.

I have used another tool "JProfiler" few times. But its only free for trial.

YoK
The second sentence of that page says, "Java VisualVM can retrieve monitoring information on remote applications but it cannot profile remote applications"
Ted Graham
@Ted Graham I have updated my answer. Added Netbeans profiler which was not suggested by anyone else. Also I found some link using which you can do remote profiling with visualvm. I will try it first and update my answer accordingly.
YoK
+1  A: 

I've gotten comfortable using the yourkit profiler: http://www.yourkit.com/

Your mileage may vary, but I like it, its worth a look. In the past I have used it to identify and avoid lock contention, and I know it has capability to identify the hot sections of your code (as would any profiler, I expect)

romacafe
+2  A: 

Yourkit is very good, except I would say that profilers in general are not very useful for exampling sub-millisecond latency applications.

However, if you haven't looked at your memory usage, then this where I would start. How are you ensuring you minimise; object creation, cache misses, context switching overhead (from passing data between threads)? Is all your code warmed up? i.e. so you are not hitting any interperated code.

I suggest you timestamp with nanoTime() the key execution path in you application to record the timing of each request at key stages to see where you are experiencing the most delay.

BTW: It is possible to get a Java application with sub 100 micro-seconds response time.

BTW2: It is possible to reduce the number of Full GCs during the day and have the system Full GC only at night. By increasing the eden size you might get to the point where you have no minor collections either.

Peter Lawrey
We have looked at memory usage a fair bit, although I'm sure we should do it again. I assume you meant sub 100 MICROseconds?
Ted Graham
@Ted, yes I did, thank you. Something I find very useful when CPU profiling is to enable memory profiling at the same time. This weights the CPU measurements to highlight where objects are being allocated by increasing the overhead adding the monitoring makes. This often yields 2-3 good places to optimise you might not have seen before.
Peter Lawrey