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

Metaspace object lifetime management is convoluted

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 21
    • 21
    • hotspot

      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.

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

              Created:
              Updated:
              Resolved: