< prev index next >
src/hotspot/share/runtime/threadHeapSampler.hpp
Print this page
rev 52084 : 8211980: Remove ThreadHeapSampler enable/disable/enabled methods
Summary:
Reviewed-by:
@@ -28,24 +28,32 @@
#include "memory/allocation.hpp"
class ThreadHeapSampler {
private:
+ // Statics for the fast log
+ static const int FastLogNumBits = 10;
+ static const int FastLogMask = (1 << FastLogNumBits) - 1;
+
size_t _bytes_until_sample;
// Cheap random number generator
static uint64_t _rnd;
+ static bool _log_table_initialized;
+
+ static double _log_table[1<<FastLogNumBits]; // Constant
+ static int _sampling_interval;
void pick_next_geometric_sample();
void pick_next_sample(size_t overflowed_bytes = 0);
- static int _enabled;
- static int _sampling_interval;
// Used for assertion mode to determine if there is a path to a TLAB slow path
// without a collector present.
size_t _collectors_present;
- static void init_log_table();
+ static double fast_log2(const double& d);
+ static bool init_log_table();
+ uint64_t next_random(uint64_t rnd);
public:
ThreadHeapSampler() : _bytes_until_sample(0) {
_rnd = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(this));
if (_rnd == 0) {
@@ -58,14 +66,10 @@
size_t bytes_until_sample() { return _bytes_until_sample; }
void set_bytes_until_sample(size_t bytes) { _bytes_until_sample = bytes; }
void check_for_sampling(oop obj, size_t size_in_bytes, size_t bytes_allocated_before);
- static int enabled();
- static void enable();
- static void disable();
-
static void set_sampling_interval(int sampling_interval);
static int get_sampling_interval();
};
#endif // SHARE_RUNTIME_THREADHEAPSAMPLER_HPP
< prev index next >