Today I sorted out how to blow through the firewalls and other blockages to get the NetBeans profiler to attach to an instrumented JVM running in the cloud. Here is a blow by blow account of all the action.
1) Download the remote profiling pack and install it in the cloud. Remember to run the calibration.
2) Setup ssh port forwarding using "ssh -N -l login_id -L 5140:localhost:5140 ec2-mycloud.compute-1.amazonaws.com
3) Start your application using the -agentlib parameter configured to point at the correct shared library.
4) Start NetBeans on your local machine and attach to localhost.
And with that, you'll be off on profiling. Oh, one last point, if you get and authentication error, just setup private/public key.
With virtualization and clouds all the rage, it was only inevitable that I'd start running into them. I like clouds, they are very useful. Now that I can profile apps running in them, I like them even more.
So, you used amazon for debugging the JVM in the cloud. Was that for experimental purposes OR you were having a real app ?
Why did you use Netbeans ? I'm sure you've used pretty much all the profilers out there in the market ?
I used NetBeans because I'm hunting down a memory leak and this is the
simplist option and yes, it's a live system.
You do know that other tools (not necessarily heap walkers) offer a local
and scripted command interface and do not require an outbound port to a
client console to run.