Profiler does not work

已回答

Hello,

I am trying to use the IntelliJ profiler.

I have a Java project using Gradle. I click on the Gradle task to profile.

 

Then I get this screen. I stop the process to debug.

And then got these screens.

 

There is no information as to what can be missing, why the profiling did not work or even logs to look at.

 

How to make the profiler work? This is basically one of the value of IntelliJ ultimate and it is just unusable for simple gradle projects.

0

Profiler works for Java only. It looks like your task runs some external process that is not a JVM. This feature does not work for arbitrary processes.

Note if the task is spawning a new JVM process, the special support is needed for every task type to be able to catch the spawned process and profile it instead of the Gradle VM process.

0

I do not understand: my program is Java and my build system is gradle. Why would we assume the program is not for Java?

Note that even if it was not supported, having a clear message that explains what is going on would be a way better developer experience than having an error without clear explanation.

I think it should still work as all the code is in Java.

0

Try running your Java app directly from IntelliJ IDEA, not via Gradle.

Use Java Application configuration and do not delegate to Gradle: https://i.imgur.com/HpeUaUE.png.

cli:run in your task name suggests that it spawns some process, the message clearly explains that spawned processes may not be detected by the profiler:

0

Thanks! Updated the settings but still no luck :(

 

 

0

Sorry but I do not understand what part of the documentation I should follow here. All I want is to profile my Java application that I build with gradle.

How can I proceed, what steps should I follow?

0

1. Create Java Application configuration type for your app.

2. Click Profile.

If it doesn't work, please provide more details / sample project to reproduce.

0

ok so I found the issue. The profiler does not work when a gradle project has submodules. We need to EXPLICITELY select the submodule to debug.

This is very confusing and not the best developer experience. IntelliJ could show some hints to troubleshoot such issues other than showing a generic error.

Thanks for the answer and help :)

1

请先登录再写评论。