< prev index next >

src/hotspot/share/runtime/heapMonitoring.hpp

Print this page
rev 47223 : [mq]: heapz8
rev 47224 : [mq]: heap9a

@@ -66,28 +66,38 @@
     const int32_t exponent = ((x_high >> 20) & 0x7FF) - 1023;
     return exponent + _log_table[y];
   }
 
  public:
+  /*
+   * General note: currently none of these methods are deemed thread-safe.
+   */
+
+  // First method called by user to start the profiler:
+  //   - Note: the lower the monitoring rate, the higher the overhead incurred.
+  static void initialize_profiling(jint monitoring_rate, jint max_storage);
+
+  // Pick the next sample for a given size_t pointer using a geometric variable
+  // with specified mean. The specified mean is provided via the
+  // initialize_profiling method.
   static void pick_next_sample(size_t *ptr);
 
+  // Get live/garbage traces and provide a method to release the traces.
   static void get_live_traces(jvmtiStackTraces* stack_traces);
-  static void get_sampling_statistics(jvmtiHeapSamplingStats* stats);
   static void get_garbage_traces(jvmtiStackTraces* stack_traces);
   static void get_frequent_garbage_traces(jvmtiStackTraces* stack_traces);
   static void release_traces(jvmtiStackTraces *trace_info);
-  static void initialize_profiling(jint monitoring_rate, jint max_storage);
+
+  static void get_sampling_statistics(jvmtiHeapSamplingStats* stats);
   static void stop_profiling();
+
+  // Is the profiler initialized and where is the address to the initialized
+  // boolean.
   static bool initialized();
   static bool *initialized_address();
 
-  // Called when o is allocated, called by interpreter and C1.
-  static void object_alloc_unsized(oopDesc* o);
-  static void object_alloc(oopDesc* o, intx byte_size);
-
-  // Called when o is allocated from C2 directly,
-  // we know the thread, and we have done the sampling.
+  // Called when o is to be sampled from a given thread and a given size.
   static void object_alloc_do_sample(Thread *t, oopDesc *o, intx size_in_bytes);
 
   // Called to clean up oops that have been saved by our sampling function,
   // but which no longer have other references in the heap.
   static size_t weak_oops_do(BoolObjectClosure* is_alive,
< prev index next >