VisualVMLauncher icon indicating copy to clipboard operation
VisualVMLauncher copied to clipboard

Automatically start profiling right away

Open stephanos opened this issue 11 years ago • 15 comments

It would be great if I could just set "Profile CPU" or "Profile RAM" before I launch the application / tests. Currently I have to do this manually and I always miss the first few seconds of execution.

stephanos avatar Dec 13 '13 09:12 stephanos

True, but I do not think VisualVM supports it.

krasa avatar Dec 13 '13 10:12 krasa

I experienced similar issues with using the plugin. My use case: profile a JUnit test case execution from IDEA 13.

  1. at the time it starts VisualVM (VVM) my test almost finished. And I need time to press profile button in VVM. Your response, it is not possible to do. My guess we can put sleep() at the begging of the unit test (temporary :)

  2. default on-fly profiling creates hot spots in code and almost useless CPU time stats. There is a work around to customize on-fly profiling under check-box "Settings" in VVM but I don't see how to ask plugin to start test with custom profile settings right way. Can you add this feature?

smile-on avatar Jan 15 '14 17:01 smile-on

Can you screenshot such settings?

krasa avatar Jan 15 '14 17:01 krasa

Please see attach. My wish is to start VVM with some "preset". vvm-preset-options

On Wed, Jan 15, 2014 at 12:45 PM, Vojtěch Krása [email protected]:

Can you screenshot such settings?

— Reply to this email directly or view it on GitHubhttps://github.com/krasa/VisualVMLauncher/issues/10#issuecomment-32389688 .

smile-on avatar Jan 15 '14 17:01 smile-on

Seriously, VisualVM does not support anything but opening the tab. Anything more would require to write a VisualVM plugin which could be called directly from IntelliJ. But in case of profiling from the very beginning of the application, I doubt it is possible at all.

Anyway, sleep() is fine, System.in.read(); is better.

krasa avatar Jan 15 '14 18:01 krasa

OK, now I kind of see the issue. The solution may look like: IntelliJ -> IntelliJ plugin (1) -> VisualVM -> VisualVM plugin (2)

plugin (1) starts VisualVM and waits on plugin (2) for message . plugin (2) loads proper "profile settings" and tells (1) to go.

I agree, all this mess just to avoid System.in.read() is not worth it. Thank you for the tip!

​Could you tell if plugin (2) would be able to kick CPU profiling? That would open up opportunity for "integration" between VisualVM and IntelliJ IDEA.

smile-on avatar Jan 15 '14 19:01 smile-on

I doubt it, but it would be better to ask on VisualVM mailing list. Currently what this and Eclipse plugin do, is executing visualvm.exe with --openid=12345 parameter. It could be possible to send any parameter needed and make visualvm do anything, but someone would need to implement such additional behaviours :)

krasa avatar Jan 15 '14 19:01 krasa

@krasa Why the options are grey?I have restarted IDEA and config the path. image

lyqscmy avatar Apr 24 '17 06:04 lyqscmy

Maybe for the same reason as Coverage... dunno.

krasa avatar Apr 24 '17 09:04 krasa

Is intellij 2017 not supported with visual vm plugin? I get the same problem as above, greyed out, but my coverage is not.

sourav-dey avatar Apr 26 '17 18:04 sourav-dey

Why do you even write into this issue? https://github.com/krasa/VisualVMLauncher/issues/14

krasa avatar Apr 26 '17 22:04 krasa

Problem #14 is a gradle problem... Mine is maven build tool....

sourav-dey avatar Apr 26 '17 23:04 sourav-dey

well, let's create another issue then.

krasa avatar Apr 27 '17 00:04 krasa

I believe this is solved by using the Startup Profiler plugin:

https://visualvm.github.io/startupprofiler.html

I got it to work

pc-mmautner avatar Oct 01 '18 15:10 pc-mmautner

+1 - I'm running IntelliJ 2018.2 and the option to run with VisualVM greyed out for a gradle/grails project.

neilabdev avatar Jan 21 '19 13:01 neilabdev