Marcono1234 ยท GitHub

Describe the bug
After profiling finished for a terminated application, starting the same application again and profiling it causes the Profiler tab of the original application to update as well.

To Reproduce

  1. Create a small Java program, for example
    class Test {
        public static void main(String... args) throws Exception {
            System.out.println("Press ENTER to exit");
            System.in.read();
        }
    }
  2. Run the program with java Test.java (requires Java 11 or newer)
  3. In VisualVM start CPU profiling the application with "Profile classes: **"
  4. In the console from step 2 press ENTER to terminate the application
  5. In VisualVM select "No" to not create a profiling results snapshot
  6. Repeat steps 2 and 3
  7. In VisualVM look at Profiler the tab of the terminated application
    โŒ Bug: It updates based on the currently running application, even though that is a separate application

Expected behavior
The Profiler tab should not update for terminated applications.

VisualVM log
logfile.txt

Screenshots
Reproduction steps video (cut)

The video shows the steps described in the "To Reproduce" section above:

  1. Profiling is started
  2. Application is stopped
  3. Application is started again (separate PID)
  4. Profiling is started
    โŒ Bug: Profiler tab of terminated application is updated by VisualVM

Desktop (please complete the following information):

  • OS: Windows 10
  • JDK version JDK 11.0.13+8
  • Version 2.1.4

Read the original on github.com โ†—