Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8289318

JDWP: defer enabling ObjectFree events for class tracking until CLASS_UNLOAD events are requested

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 20
    • core-svc
    • None

      During reviewing JDK-8256811, [~cjplummer] has following comments (https://github.com/openjdk/jdk/pull/9168#discussion_r907812755)
      "This looked a bit strange to me w.r.t. when we activate class tracking, so I looked into it. It turns out that when the debugger sends a request for CLASS_UNLOAD events, we convert it to EI_GC_FINISH and install a handler for it (and activate class tracking as you see in the above code). Activating doesn't do much. In fact it's not even where the ObjectFree events are enabled. This is done unconditionally in `classTrack_initialize()`, which is called whenever the debug agent is initialized. This means we always have the ObjectFree events enabled, even when the debugger has not requested CLASS_LOAD events. This seems like a bit of a performance issue. Maybe `classTrack_activate()` is where we should be enabling ObjectFree events. We should probably file a separate CR to have this fixed"

            Unassigned Unassigned
            zgu Zhengyu Gu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: