Profiling Gradle task with IntelliJ plugin

Questions about YourKit Java Profiler
Post Reply
noziar
Posts: 1
Joined: Wed Dec 25, 2019 10:08 pm

Profiling Gradle task with IntelliJ plugin

Post by noziar »

Hi,

I'm trying to profile a Gradle-based project. The YourKit plugin for IntelliJ only seems to support the "Application" Run/Debug configuration type, not the "Gradle" configuration type (the YourKit icon remains grayed out). What would be the best way to profile a Gradle task (typically the "run" and "test" tasks) ?

Thanks for the great work on YourKit !
echauchot
Posts: 2
Joined: Fri Feb 07, 2020 10:45 am

Re: Profiling Gradle task with IntelliJ plugin

Post by echauchot »

Yourkit is great!
But I must admit that I'm interested in a response too.
I'd like to profile tests run with gradle.
Indeed yourkit icon in the IDE is grayed out when using gradle.
I'd like to run the java agent with my test to avoid attach mode limitations of yourkit.
As specified in the doc I added de VM option -agentpath to my gradle run configuration but only gradle daemon receives the agent, not the gradle workers that actually run the tests.
Is there a way to have gradle support by any other mean?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profiling Gradle task with IntelliJ plugin

Post by Anton Katilin »

Hi,

Please try to specify the -agentpath option via the environment variable JAVA_TOOL_OPTIONS. It should be inherited by child processes. Does this work for you?

Best regards,
Anton
echauchot
Posts: 2
Joined: Fri Feb 07, 2020 10:45 am

Re: Profiling Gradle task with IntelliJ plugin

Post by echauchot »

Hi Anton,
Thanks for the quick reply !
Yes it works and I have put the environnement variable in the run configuration of intelliJ to avoid having it in all the JVMs of my system. I replaces the intellij plugin quite well.
I humbly advice that we make the intellij plugin do this same thing and that you enable this plugin on gradle projects.
Post Reply