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

Remove MetaspaceClosure::Ref::keep_after_pushing()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • None
    • hotspot
    • b24

      We currently keep a reference to the MetaspaceClosure::Ref inside ArchiveBuilder::SourceObjInfo:

      https://github.com/openjdk/jdk/blob/6f75dd8741f44b3012c5cab5268e89d09121e4be/src/hotspot/share/cds/archiveBuilder.hpp#L125-L126

      ArchiveBuilder uses the Ref::keep_after_pushing() API to tell MetaspaceClosure to keep the Ref alive, even though MetaspaceClosure has finished using it.

      This makes the lifecycle convoluted.

      The only reason to keep the Ref inside SourceObjInfo is to query Ref::msotype() and Ref::obj(), but we're already cached these values in SourceObjInfo::msotype() and SourceObjInfo::source_addr(). So there's no need to keep the Ref around.

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: