Briefly reading tutorials and playing with JVisualVM, I can manually attach it to a long-running server or Swing application, but I'd also like to use it for short programs that run in under a second.
I suppose I could have my program block on the console, attach JVisualVM, and then hit a key to have the program do its real work. Is there a less kludgy workaround?
(This is mainly for my own curiosity, and it would be nice to use a polished GUI like JVisualVM instead of -Xprof or HPROF).