What does this PR do?:
It adds defensive deallocation of jclass references to reduce the chance of crashing due to mismanaged jmethodID in JVM.
Motivation:
See async-profiler/async-profiler#981 and https://bugs.openjdk.org/browse/JDK-8268364
Additional Notes:
How to test the change?:
For Datadog employees:
- If this PR touches code that signs or publishes builds or packages, or handles
credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
- This PR doesn't touch any of that.
- JIRA: PROF-10461
Unsure? Have a question? Request a review!