diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp index b1c502e17f8..3dd9ea41d3d 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp @@ -1265,7 +1265,7 @@ static size_t teardown() { JfrKlassUnloading::clear(); _artifacts->clear(); _initial_type_set = true; - } else { + } else if (is_initial_typeset_for_chunk()) { _initial_type_set = false; } return total_count; diff --git a/src/hotspot/share/jfr/recorder/jfrRecorder.cpp b/src/hotspot/share/jfr/recorder/jfrRecorder.cpp index 061e3feac6f..5c12d5213ca 100644 --- a/src/hotspot/share/jfr/recorder/jfrRecorder.cpp +++ b/src/hotspot/share/jfr/recorder/jfrRecorder.cpp @@ -102,6 +102,9 @@ bool JfrRecorder::on_create_vm_1() { if (!create_checkpoint_manager()) { return false; } + if (!JfrSymbolTable::create()) { + return false; + } } // fast time initialization @@ -316,10 +319,7 @@ bool JfrRecorder::create_components() { if (!create_thread_group_manager()) { return false; } - if (!create_symbol_table()) { - return false; - } - return true; + return create_symbol_table(); } // subsystems @@ -418,7 +418,13 @@ bool JfrRecorder::create_thread_group_manager() { } bool JfrRecorder::create_symbol_table() { - return JfrSymbolTable::create(); + return !is_started_on_commandline() ? JfrSymbolTable::create() : true; +} + +void JfrRecorder::destroy_symbol_table() { + if (!is_started_on_commandline()) { + JfrSymbolTable::destroy(); + } } void JfrRecorder::destroy_components() { @@ -461,7 +467,7 @@ void JfrRecorder::destroy_components() { } JfrEventThrottler::destroy(); JfrThreadGroupManager::destroy(); - JfrSymbolTable::destroy(); + destroy_symbol_table(); } bool JfrRecorder::create_recorder_thread() { diff --git a/src/hotspot/share/jfr/recorder/jfrRecorder.hpp b/src/hotspot/share/jfr/recorder/jfrRecorder.hpp index 8cc4521669d..fa1b677b31a 100644 --- a/src/hotspot/share/jfr/recorder/jfrRecorder.hpp +++ b/src/hotspot/share/jfr/recorder/jfrRecorder.hpp @@ -59,6 +59,7 @@ class JfrRecorder : public JfrCHeapObj { static bool create_event_throttler(); static bool create_symbol_table(); static bool create_components(); + static void destroy_symbol_table(); static void destroy_components(); static void on_recorder_thread_exit();