How to profile application launch using visualvm

As far as I can tell, you can profile a running application using VisualVM .

Does anyone know a way to profile launching and launching a Java application using VisualVM?

I am convinced that there must be some way, otherwise it will be serious oversight.

Hope I just misread the documentation.

Thanks p.

+49
java profiling visualvm
Dec 14 2018-10-12T00:
source share
4 answers

Do you configure profiling with the `-Xrunjdwp 'command line option? If so, this parameter has a suspend parameter for this purpose:

True, if the target VM must be suspended immediately before loading the main class; false otherwise.

An example from my own configuration:

-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n 

I use this with YourKit profiler, but I think the principle is the same.

+9
Dec 14 2018-10-12T00:
source share
β€” -

Use the eclipse launcher and set a breakpoint at the appropriate location in the main method.

Then, start in debug mode, enable profiling in visualVM, and then resume using eclipse.

This will not profile class loading and stuff, but for me it is good enough.

+17
Sep 19 '11 at 12:52
source share

I found the Startup Profiler useful:

The Profiler launch plugin for VisualVM 1.3.6 allows you to use the tools to profile local Java 5+ applications from their launch. It is also useful when profiling short workflows.

+6
Feb 04 '15 at 9:15
source share

Both common Java development environments (NetBeans / Eclipse) support running the application directly with VisualVM connected. In the case of Eclipse, you must install the plugin . In the case of NetBeans, support is already included in AFAIK.
Even if you don’t have any sources, you can still run JAR files through both environments and therefore run a VisualVM-related application.

0
Dec 15 '10 at 15:39
source share



All Articles