26 #define SHARE_VM_JFR_LEAKPROFILER_LEAKPROFILER_HPP |
26 #define SHARE_VM_JFR_LEAKPROFILER_LEAKPROFILER_HPP |
27 |
27 |
28 #include "memory/allocation.hpp" |
28 #include "memory/allocation.hpp" |
29 |
29 |
30 class BoolObjectClosure; |
30 class BoolObjectClosure; |
31 class ObjectSampler; |
|
32 class OopClosure; |
31 class OopClosure; |
33 class Thread; |
|
34 |
32 |
35 class LeakProfiler : public AllStatic { |
33 class LeakProfiler : public AllStatic { |
36 friend class ClassUnloadTypeSet; |
|
37 friend class EmitEventOperation; |
|
38 friend class ObjectSampleCheckpoint; |
|
39 friend class StartOperation; |
|
40 friend class StopOperation; |
|
41 friend class TypeSet; |
|
42 friend class WriteObjectSampleStacktrace; |
|
43 |
|
44 private: |
|
45 static ObjectSampler* _object_sampler; |
|
46 |
|
47 static void set_object_sampler(ObjectSampler* object_sampler); |
|
48 static ObjectSampler* object_sampler(); |
|
49 |
|
50 static void suspend(); |
|
51 static void resume(); |
|
52 static bool is_suspended(); |
|
53 |
|
54 public: |
34 public: |
55 static bool start(jint sample_count); |
35 static bool start(int sample_count); |
56 static bool stop(); |
36 static bool stop(); |
57 static void emit_events(jlong cutoff_ticks, bool emit_all); |
|
58 static bool is_running(); |
37 static bool is_running(); |
59 |
38 |
|
39 static void emit_events(int64_t cutoff_ticks, bool emit_all); |
60 static void sample(HeapWord* object, size_t size, JavaThread* thread); |
40 static void sample(HeapWord* object, size_t size, JavaThread* thread); |
61 |
41 |
62 // Called by GC |
42 // Called by GC |
63 static void oops_do(BoolObjectClosure* is_alive, OopClosure* f); |
43 static void oops_do(BoolObjectClosure* is_alive, OopClosure* f); |
64 }; |
44 }; |