8322489: 22-b27: Up to 7% regression in all Footprint3-*-G1/ZGC
Reviewed-by: egahlin
This commit is contained in:
parent
eb9e754b3a
commit
09c6c4ff02
src/hotspot/share/jfr
@ -67,7 +67,9 @@ void Jfr::on_create_vm_3() {
|
||||
}
|
||||
|
||||
void Jfr::on_unloading_classes() {
|
||||
JfrCheckpointManager::on_unloading_classes();
|
||||
if (JfrRecorder::is_created() || JfrRecorder::is_started_on_commandline()) {
|
||||
JfrCheckpointManager::on_unloading_classes();
|
||||
}
|
||||
}
|
||||
|
||||
bool Jfr::is_excluded(Thread* t) {
|
||||
|
@ -117,16 +117,16 @@ bool JfrCheckpointManager::initialize_early() {
|
||||
assert(_thread_local_mspace == nullptr, "invariant");
|
||||
_thread_local_mspace = new JfrThreadLocalCheckpointMspace();
|
||||
if (_thread_local_mspace == nullptr || !_thread_local_mspace->initialize(thread_local_buffer_size,
|
||||
thread_local_buffer_prealloc_count,
|
||||
thread_local_buffer_prealloc_count)) {
|
||||
thread_local_buffer_prealloc_count,
|
||||
thread_local_buffer_prealloc_count)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(_virtual_thread_local_mspace == nullptr, "invariant");
|
||||
_virtual_thread_local_mspace = new JfrThreadLocalCheckpointMspace();
|
||||
if (_virtual_thread_local_mspace == nullptr || !_virtual_thread_local_mspace->initialize(virtual_thread_local_buffer_size,
|
||||
JFR_MSPACE_UNLIMITED_CACHE_SIZE,
|
||||
virtual_thread_local_buffer_prealloc_count)) {
|
||||
JFR_MSPACE_UNLIMITED_CACHE_SIZE,
|
||||
virtual_thread_local_buffer_prealloc_count)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -55,6 +55,7 @@ struct JfrCheckpointContext {
|
||||
|
||||
class JfrCheckpointWriter : public JfrCheckpointWriterBase {
|
||||
friend class JfrCheckpointManager;
|
||||
friend class JfrDeprecationManager;
|
||||
friend class JfrSerializerRegistration;
|
||||
friend class JfrTypeManager;
|
||||
private:
|
||||
|
@ -86,9 +86,6 @@ bool JfrRecorder::create_oop_storages() {
|
||||
return ObjectSampler::create_oop_storage();
|
||||
}
|
||||
|
||||
// Subsystem
|
||||
static JfrCheckpointManager* _checkpoint_manager = nullptr;
|
||||
|
||||
bool JfrRecorder::on_create_vm_1() {
|
||||
if (!is_disabled()) {
|
||||
if (FlightRecorder || is_started_on_commandline()) {
|
||||
@ -99,9 +96,10 @@ bool JfrRecorder::on_create_vm_1() {
|
||||
return false;
|
||||
}
|
||||
|
||||
_checkpoint_manager = JfrCheckpointManager::create();
|
||||
if (_checkpoint_manager == nullptr || !_checkpoint_manager->initialize_early()) {
|
||||
return false;
|
||||
if (is_started_on_commandline()) {
|
||||
if (!create_checkpoint_manager()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// fast time initialization
|
||||
@ -292,7 +290,7 @@ bool JfrRecorder::create_components() {
|
||||
if (!create_storage()) {
|
||||
return false;
|
||||
}
|
||||
if (!create_checkpoint_manager()) {
|
||||
if (!initialize_checkpoint_manager()) {
|
||||
return false;
|
||||
}
|
||||
if (!create_stacktrace_repository()) {
|
||||
@ -321,6 +319,7 @@ static JfrStackTraceRepository* _stack_trace_repository;
|
||||
static JfrStringPool* _stringpool = nullptr;
|
||||
static JfrOSInterface* _os_interface = nullptr;
|
||||
static JfrThreadSampling* _thread_sampling = nullptr;
|
||||
static JfrCheckpointManager* _checkpoint_manager = nullptr;
|
||||
|
||||
bool JfrRecorder::create_java_event_writer() {
|
||||
return JfrJavaEventWriter::initialize();
|
||||
@ -357,6 +356,17 @@ bool JfrRecorder::create_storage() {
|
||||
}
|
||||
|
||||
bool JfrRecorder::create_checkpoint_manager() {
|
||||
assert(_checkpoint_manager == nullptr, "invariant");
|
||||
_checkpoint_manager = JfrCheckpointManager::create();
|
||||
return _checkpoint_manager != nullptr && _checkpoint_manager->initialize_early();
|
||||
}
|
||||
|
||||
bool JfrRecorder::initialize_checkpoint_manager() {
|
||||
if (_checkpoint_manager == nullptr) {
|
||||
if (!create_checkpoint_manager()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
assert(_checkpoint_manager != nullptr, "invariant");
|
||||
assert(_repository != nullptr, "invariant");
|
||||
return _checkpoint_manager->initialize(&_repository->chunkwriter());
|
||||
|
@ -42,6 +42,7 @@ class JfrRecorder : public JfrCHeapObj {
|
||||
static bool on_create_vm_2();
|
||||
static bool on_create_vm_3();
|
||||
static bool create_checkpoint_manager();
|
||||
static bool initialize_checkpoint_manager();
|
||||
static bool create_chunk_repository();
|
||||
static bool create_java_event_writer();
|
||||
static bool create_jvmti_agent();
|
||||
|
@ -371,8 +371,10 @@ void JfrDeprecationManager::write_edges(JfrChunkWriter& cw, Thread* thread, bool
|
||||
|
||||
void JfrDeprecationManager::on_type_set(JfrCheckpointWriter& writer, JfrChunkWriter* cw, Thread* thread) {
|
||||
assert(_pending_list.is_empty(), "invariant");
|
||||
if (writer.has_data() && _pending_head != nullptr) {
|
||||
if (_pending_head != nullptr) {
|
||||
save_type_set_blob(writer);
|
||||
} else {
|
||||
writer.cancel();
|
||||
}
|
||||
if (cw != nullptr) {
|
||||
write_edges(*cw, thread);
|
||||
|
Loading…
x
Reference in New Issue
Block a user