diff -r 1258121876f8 -r 8e875c964f41 src/share/vm/jfr/leakprofiler/stopOperation.hpp --- a/src/share/vm/jfr/leakprofiler/stopOperation.hpp Fri Sep 27 13:23:32 2019 +0800 +++ b/src/share/vm/jfr/leakprofiler/stopOperation.hpp Wed Oct 09 16:11:58 2019 +0800 @@ -25,30 +25,14 @@ #ifndef SHARE_VM_LEAKPROFILER_STOPOPERATION_HPP #define SHARE_VM_LEAKPROFILER_STOPOPERATION_HPP -#include "jfr/leakprofiler/leakProfiler.hpp" #include "jfr/leakprofiler/sampling/objectSampler.hpp" -#include "jfr/recorder/service/jfrOptionSet.hpp" -#include "runtime/vm_operations.hpp" +#include "jfr/leakprofiler/utilities/vmOperation.hpp" -// Safepoint operation for stopping leak profiler object sampler -class StopOperation : public VM_Operation { +// Safepoint operation for stopping and destroying the leak profiler object sampler +class StopOperation : public OldObjectVMOperation { public: - StopOperation() {} - - Mode evaluation_mode() const { - return _safepoint; - } - - VMOp_Type type() const { - return VMOp_GC_HeapInspection; - } - virtual void doit() { - assert(LeakProfiler::is_running(), "invariant"); - ObjectSampler* object_sampler = LeakProfiler::object_sampler(); - delete object_sampler; - LeakProfiler::set_object_sampler(NULL); - if (LogJFR && Verbose) tty->print_cr( "Object sampling stopped"); + ObjectSampler::destroy(); } };