Redundant MethodCounters in the preimage generated by training run

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 26
    • Component/s: hotspot

      There are two ways MethodCounters can get into the cache:
      1. through Method (see Method::metaspace_pointers_do)
      2. through MethodTrainingData
      (see MethodTrainingData::metaspace_pointers_do)

      MethodCounters added through Method seem to be redundant because we severe the Method->MethodCounter link in Method::unlink_method() when writing the archive. This means the Methods adopted from the preimage in the assembly phase do not have MethodCounters. And since we don't execute the application, we don't create MethodCounters for the Methods loaded from the preimage. Only the MethodCounters discoverable via MethodTrainingData seep into the AOTCache.

      Ideally we should only be adding MethodCounters
      through the MethodTrainingData and not through Method.

      More details in this thread: https://mail.openjdk.org/pipermail/leyden-dev/2025-December/002843.html

            Assignee:
            Ashutosh Mehra
            Reporter:
            Ashutosh Mehra
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: