how to profile application startup with visualvm

后端 未结 4 1699
無奈伤痛
無奈伤痛 2020-12-04 19:18

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

Does anyone know of a way to profile the launch and startup of a java application us

4条回答
  •  無奈伤痛
    2020-12-04 19:52

    Are you setting up the profiling using the `-Xrunjdwp" command-line option? If so, that option has a "suspend" parameter for just this purpose:

    True if the target VM is to be suspended immediately before the main class is loaded; false otherwise.

    Example from my own config:

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

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

提交回复
热议问题