mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
7122253: Instrumentation.retransformClasses() leaks class bytes
Change ClassFileParser::parseClassFile() to use the instanceKlass:_cached_class_file_bytes field to avoid leaking the cache. Reviewed-by: coleenp, acorn, poonam
This commit is contained in:
parent
5232221c68
commit
c210a09fdf
4 changed files with 41 additions and 9 deletions
|
@ -267,7 +267,10 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) {
|
|||
|
||||
instanceKlassHandle ikh(current_thread, k_oop);
|
||||
if (ikh->get_cached_class_file_bytes() == NULL) {
|
||||
// not cached, we need to reconstitute the class file from VM representation
|
||||
// Not cached, we need to reconstitute the class file from the
|
||||
// VM representation. We don't attach the reconstituted class
|
||||
// bytes to the instanceKlass here because they have not been
|
||||
// validated and we're not at a safepoint.
|
||||
constantPoolHandle constants(current_thread, ikh->constants());
|
||||
ObjectLocker ol(constants, current_thread); // lock constant pool while we query it
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue