I want to add an option in my application where the end user can start CPU profiling, reproduce a performance issue, stop CPU profiling, and then send the profiling information to our support team as an attachment to an email. I'm hoping I can use the same mechanism that JVisualVM uses to stop and start the profiling and return the results.
Does anybody know how JVisualVM makes this happen? It doesn't require the -agentlib:hprof option to be set on the command line - does it use hprof or some other mechanism?