-
Enhancement
-
Resolution: Fixed
-
P3
-
17, 21
-
b22
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8337882 | 17.0.13 | Oli Gillespie | P3 | Resolved | Fixed | b02 |
When transforming/redefining classes a previous version list is linked together in the InstanceKlass if the original class is still used or shared. This difference between shared and used is not currently noted. This leads to a problem when doing concurrent class unloading, because during that we postpone some potential work to a safepoint (since we are not in one). This is the CleanClassLoaderDataMetaspaces and it is triggered by the ServiceThread if there is work to be done, for example if InstanceKlass::_has_previous_versions is true.
Since we currently does not differentiate between shared and "in use" we always set _has_previous_versions if anything is on this list. This together with the fact that shared previous versions should never be cleaned out leads to this safepoint being triggered after every concurrent class unloading even though there is no work to be done.
This can be avoided by making sure the _previous_versions list is only cleaned when there are non-shared classes on it.
Since we currently does not differentiate between shared and "in use" we always set _has_previous_versions if anything is on this list. This together with the fact that shared previous versions should never be cleaned out leads to this safepoint being triggered after every concurrent class unloading even though there is no work to be done.
This can be avoided by making sure the _previous_versions list is only cleaned when there are non-shared classes on it.
- backported by
-
JDK-8337882 Avoid CleanClassLoaderDataMetaspaces safepoints when previous versions are shared
- Resolved
- duplicates
-
JDK-8335327 ClassLoaderDataGraph::purge triggers safepoints too often
- Closed
- relates to
-
JDK-8307448 Test RedefineSharedClassJFR fail due to wrong assumption
- Resolved
- links to
-
Commit openjdk/jdk/408cec51
-
Commit(master) openjdk/jdk17u-dev/1f14f860
-
Review(master) openjdk/jdk17u-dev/2776
-
Review(master) openjdk/jdk/13716
(2 links to)