< prev index next >

src/hotspot/share/runtime/heapMonitoring.hpp

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


  57     return (PrngMult * rnd + prng_add) & prng_mod_mask;
  58   }
  59 
  60   static inline double fast_log2(const double & d) {
  61     assert(d>0, "bad value passed to assert");
  62     uint64_t x = 0;
  63     memcpy(&x, &d, sizeof(uint64_t));
  64     const uint32_t x_high = x >> 32;
  65     const uint32_t y = x_high >> (20 - FastLogNumBits) & FastLogMask;
  66     const int32_t exponent = ((x_high >> 20) & 0x7FF) - 1023;
  67     return exponent + _log_table[y];
  68   }
  69 
  70  public:
  71   /*
  72    * General note: currently none of these methods are deemed thread-safe.
  73    */
  74 
  75   // First method called by user to start the profiler:
  76   //   - Note: the lower the monitoring rate, the higher the overhead incurred.
  77   static void initialize_profiling(jint monitoring_rate, jint max_storage);
  78 
  79   // Pick the next sample for a given size_t pointer using a geometric variable
  80   // with specified mean. The specified mean is provided via the
  81   // initialize_profiling method.
  82   static void pick_next_sample(size_t *ptr);
  83 
  84   // Get live/garbage traces and provide a method to release the traces.
  85   static void get_live_traces(jvmtiStackTraces* stack_traces);
  86   static void get_garbage_traces(jvmtiStackTraces* stack_traces);
  87   static void get_frequent_garbage_traces(jvmtiStackTraces* stack_traces);
  88   static void release_traces(jvmtiStackTraces *trace_info);
  89 
  90   static void get_sampling_statistics(jvmtiHeapSamplingStats* stats);
  91   static void stop_profiling();
  92 
  93   // Is the profiler initialized and where is the address to the initialized
  94   // boolean.
  95   static bool initialized();
  96   static bool *initialized_address();
  97 


  57     return (PrngMult * rnd + prng_add) & prng_mod_mask;
  58   }
  59 
  60   static inline double fast_log2(const double & d) {
  61     assert(d>0, "bad value passed to assert");
  62     uint64_t x = 0;
  63     memcpy(&x, &d, sizeof(uint64_t));
  64     const uint32_t x_high = x >> 32;
  65     const uint32_t y = x_high >> (20 - FastLogNumBits) & FastLogMask;
  66     const int32_t exponent = ((x_high >> 20) & 0x7FF) - 1023;
  67     return exponent + _log_table[y];
  68   }
  69 
  70  public:
  71   /*
  72    * General note: currently none of these methods are deemed thread-safe.
  73    */
  74 
  75   // First method called by user to start the profiler:
  76   //   - Note: the lower the monitoring rate, the higher the overhead incurred.
  77   static void initialize_profiling(jint monitoring_rate, jint max_gc_storage);
  78 
  79   // Pick the next sample for a given size_t pointer using a geometric variable
  80   // with specified mean. The specified mean is provided via the
  81   // initialize_profiling method.
  82   static void pick_next_sample(size_t *ptr);
  83 
  84   // Get live/garbage traces and provide a method to release the traces.
  85   static void get_live_traces(jvmtiStackTraces* stack_traces);
  86   static void get_garbage_traces(jvmtiStackTraces* stack_traces);
  87   static void get_frequent_garbage_traces(jvmtiStackTraces* stack_traces);
  88   static void release_traces(jvmtiStackTraces *trace_info);
  89 
  90   static void get_sampling_statistics(jvmtiHeapSamplingStats* stats);
  91   static void stop_profiling();
  92 
  93   // Is the profiler initialized and where is the address to the initialized
  94   // boolean.
  95   static bool initialized();
  96   static bool *initialized_address();
  97 
< prev index next >