visualvm icon indicating copy to clipboard operation
visualvm copied to clipboard

Profiling results are empty in Profiler tab

Open APPravin opened this issue 3 years ago • 3 comments

Hi, I am trying to profile my SpringBoot application with VisualVM. But when I open profiler tab and click on CPU button,it process successfully and shows the status as 'profiling successfully', but in the profiling results table, it doesn't show anything. Same thing for the memory button. I also have attached the screenshots of the same. I am using JDK 11 and Visual VM 2.0.7 version on windows 10 (64-bit).

Please help. Thanks. Screenshot (30) Screenshot (32)

APPravin avatar Apr 25 '21 17:04 APPravin

This hard to tell without actual code of com.examle.ApApplication class, but I guess that no com.examle.ApApplication code is running after you started profiling. Can you provide steps to reproduce?

thurka avatar Apr 27 '21 14:04 thurka

Following is the code I am running :

package a.p; @SpringBootApplication public class ApApplication { static List<ApApplication> visualVMTestList = new ArrayList<ApApplication>(); public static void main(String[] args) { SpringApplication.run(ApApplication.class, args); ap(); } public static void ap() { for (int i = 0; i <= 10000; i++) { visualVMTestList.add(new ApApplication()); } System.out.println("AP called"); } }

Following are the steps I am performing: 1.Run an application as Springboot Application. 2.Open VisualVM and open running application PID in visualVM. 3.Then Go to profiler tab.By default the status is 'inactive'. 4.Added package a.p.** in profiler classes box for both CPU settings and memory settings. 5.Click on CPU button.Status changed to profiling running and 14 methods instrumented. -But still the profiling results are empty.

Thanks.

APPravin avatar Apr 27 '21 16:04 APPravin

I am not familiar with SpringBoot application, but are you sure that the ap() method is invoked after the started the profiling? What does SpringApplication.run() do? How do you know that SpringApplication.run() ended? Is AP called text written to console? If so, is it before or after you started profiling?

thurka avatar Apr 30 '21 09:04 thurka

Closing until more info is available.

thurka avatar Aug 30 '23 13:08 thurka