diff --git a/src/profiler.cpp b/src/profiler.cpp index a9b3351e..5d29c6e0 100644 --- a/src/profiler.cpp +++ b/src/profiler.cpp @@ -906,9 +906,7 @@ Engine* Profiler::selectEngine(const char* event_name) { } Engine* Profiler::selectAllocEngine(long alloc_interval, bool live) { - if (VM::canSampleObjects() && (alloc_interval > 0 || live || - VM::hotspot_version() == 0 || - !VMStructs::libjvm()->hasDebugSymbols())) { + if (VM::canSampleObjects()) { return &object_sampler; } else if (VM::isOpenJ9()) { return &j9_object_sampler; diff --git a/src/vmEntry.cpp b/src/vmEntry.cpp index 5a1caeb1..89fcf64a 100644 --- a/src/vmEntry.cpp +++ b/src/vmEntry.cpp @@ -119,11 +119,11 @@ bool VM::init(JavaVM* vm, bool attach) { } if (is_hotspot && _jvmti->GetSystemProperty("java.vm.version", &prop) == 0) { - if (strncmp(prop, "25.", 3) == 0) { + if (strncmp(prop, "25.", 3) == 0 && prop[3] > '0') { _hotspot_version = 8; - } else if (strncmp(prop, "24.", 3) == 0) { + } else if (strncmp(prop, "24.", 3) == 0 && prop[3] > '0') { _hotspot_version = 7; - } else if (strncmp(prop, "20.", 3) == 0) { + } else if (strncmp(prop, "20.", 3) == 0 && prop[3] > '0') { _hotspot_version = 6; } else if ((_hotspot_version = atoi(prop)) < 9) { _hotspot_version = 9;