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

Metaspace object lifetime management is convoluted

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Won't Fix
    • 21
    • 21
    • hotspot

    Description

      See the reviews on https://github.com/openjdk/jdk/pull/11526. The object lifetime management of Metaspace is highly convoluted, especially for `MethodData`. The destructor is called and immediately after a member function is called. This is extremely likely to be undefined behavior, as after the destructor returns the contents of the object are considered uninitialized.

      This usage should be reviewed and likely changed, such as introducing virtual destructors and calling destructors immediately before returning memory to the underlying heap in MetaspaceFactory::free_metadata.

      Attachments

        Issue Links

          Activity

            People

              coleenp Coleen Phillimore
              jcking Justin King
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: