< prev index next >

src/hotspot/share/runtime/threadHeapSampler.cpp

Print this page




 122 
 123   pick_next_geometric_sample();
 124 }
 125 
 126 void ThreadHeapSampler::check_for_sampling(oop obj, size_t allocation_size, size_t bytes_since_allocation) {
 127   size_t total_allocated_bytes = bytes_since_allocation + allocation_size;
 128 
 129   // If not yet time for a sample, skip it.
 130   if (total_allocated_bytes < _bytes_until_sample) {
 131     _bytes_until_sample -= total_allocated_bytes;
 132     return;
 133   }
 134 
 135   JvmtiExport::sampled_object_alloc_event_collector(obj);
 136 
 137   size_t overflow_bytes = total_allocated_bytes - _bytes_until_sample;
 138   pick_next_sample(overflow_bytes);
 139 }
 140 
 141 int ThreadHeapSampler::get_sampling_interval() {
 142   return OrderAccess::load_acquire(&_sampling_interval);
 143 }
 144 
 145 void ThreadHeapSampler::set_sampling_interval(int sampling_interval) {
 146   OrderAccess::release_store(&_sampling_interval, sampling_interval);
 147 }


 122 
 123   pick_next_geometric_sample();
 124 }
 125 
 126 void ThreadHeapSampler::check_for_sampling(oop obj, size_t allocation_size, size_t bytes_since_allocation) {
 127   size_t total_allocated_bytes = bytes_since_allocation + allocation_size;
 128 
 129   // If not yet time for a sample, skip it.
 130   if (total_allocated_bytes < _bytes_until_sample) {
 131     _bytes_until_sample -= total_allocated_bytes;
 132     return;
 133   }
 134 
 135   JvmtiExport::sampled_object_alloc_event_collector(obj);
 136 
 137   size_t overflow_bytes = total_allocated_bytes - _bytes_until_sample;
 138   pick_next_sample(overflow_bytes);
 139 }
 140 
 141 int ThreadHeapSampler::get_sampling_interval() {
 142   return Atomic::load_acquire(&_sampling_interval);
 143 }
 144 
 145 void ThreadHeapSampler::set_sampling_interval(int sampling_interval) {
 146   Atomic::release_store(&_sampling_interval, sampling_interval);
 147 }
< prev index next >