krasa / VisualVMLauncher

IntelliJ plugin - https://plugins.jetbrains.com/plugin/7115
Apache License 2.0
108 stars 19 forks source link

Automatically start profiling right away #10

Open stephanos opened 10 years ago

stephanos commented 10 years ago

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.

krasa commented 10 years ago

True, but I do not think VisualVM supports it.

smile-on commented 10 years ago

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?

krasa commented 10 years ago

Can you screenshot such settings?

smile-on commented 10 years ago

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 notifications@github.comwrote:

Can you screenshot such settings?

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

krasa commented 10 years ago

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.

smile-on commented 10 years ago

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.

krasa commented 10 years ago

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 :)

lyqscmy commented 7 years ago

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

krasa commented 7 years ago

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

sourav-dey commented 7 years ago

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

krasa commented 7 years ago

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

sourav-dey commented 7 years ago

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

krasa commented 7 years ago

well, let's create another issue then.

pc-mmautner commented 6 years ago

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

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

I got it to work

neilabdev commented 5 years ago

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