Use `ClassLoaderIndex` to index class-loader related information by mcculls · Pull Request #9980 · DataDog/dd-trace-java
What Does This Do
ClassLoaderIndex provides a stable numeric key-id for each live class-loader which can be used to record class-loader origin and match against it without storing weak references everywhere. (The index itself uses weak references, but clients using the index can simply use the numeric key-id.)
Note a class-loader may have more than one key-id over its life if it is temporarily displaced from the index. For example if a large number of class-loaders (>500) happened to be created in parallel. This would be very unusual, and at worst any cached type info under the old key-id would no longer match. This just means the type info would be recomputed and cached under the new key-id.
Motivation
Reduces direct use of class-loader weak references in the codebase.
Contributor Checklist
- Format the title according the contribution guidelines
- Assign the
type:and (comp:orinst:) labels in addition to any useful labels - Don't use
close,fixor any linking keywords when referencing an issue.
Usesolvesinstead, and assign the PR milestone to the issue - Update the CODEOWNERS file on source file addition, move, or deletion
- Update the public documentation in case of new configuration flag or behavior
Jira ticket: APMAPI-1654