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.
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.
- relates to
-
JDK-8298084 Memory leak in Method::build_profiling_method_data
-
- Resolved
-