Faster alternative to get tags for objects than JVMTI GetTag
问题 When profiling with async profiler and gperftools I noticed that jvmti->GetTag shows up quite a lot in the results for my agent. When I checked how it is implemented I found the following in the source of jvmitTagMap.cpp : jlong JvmtiTagMap::get_tag(jobject object) { MutexLocker ml(lock()); // resolve the object oop o = JNIHandles::resolve_non_null(object); // for Classes get the tag from the klassOop return tag_for(this, klassOop_if_java_lang_Class(o)); } Although my test only had one thread