< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahNumberSeq.hpp

Print this page

33 // the low resolution histogram within that magnitude. For example, storing
34 // 4.352819 * 10^3 increments the bucket _hdr[3][435]. This allows for
35 // memory efficient storage of huge amount of samples.
36 //
37 // Accepts positive numbers only.
38 class HdrSeq: public NumberSeq {
39 private:
40   enum PrivateConstants {
41     ValBuckets = 512,
42     MagBuckets = 24,
43     MagMinimum = -12
44   };
45   int** _hdr;
46 
47 public:
48   HdrSeq();
49   ~HdrSeq();
50 
51   virtual void add(double val);
52   double percentile(double level) const;



53 };
54 
55 // Binary magnitude sequence stores the power-of-two histogram.
56 // It has very low memory requirements, and is thread-safe. When accuracy
57 // is not needed, it is preferred over HdrSeq.
58 class BinaryMagnitudeSeq : public CHeapObj<mtGC> {
59 private:
60   size_t  _sum;
61   size_t* _mags;
62 
63 public:
64   BinaryMagnitudeSeq();
65   ~BinaryMagnitudeSeq();
66 
67   void add(size_t val);
68   size_t num() const;
69   size_t level(int level) const;
70   size_t sum() const;
71   int min_level() const;
72   int max_level() const;

33 // the low resolution histogram within that magnitude. For example, storing
34 // 4.352819 * 10^3 increments the bucket _hdr[3][435]. This allows for
35 // memory efficient storage of huge amount of samples.
36 //
37 // Accepts positive numbers only.
38 class HdrSeq: public NumberSeq {
39 private:
40   enum PrivateConstants {
41     ValBuckets = 512,
42     MagBuckets = 24,
43     MagMinimum = -12
44   };
45   int** _hdr;
46 
47 public:
48   HdrSeq();
49   ~HdrSeq();
50 
51   virtual void add(double val);
52   double percentile(double level) const;
53 
54   // Merge this HdrSeq into hdr2, optionally clearing this HdrSeq
55   void merge(HdrSeq& hdr2, bool clear_this = true);
56 };
57 
58 // Binary magnitude sequence stores the power-of-two histogram.
59 // It has very low memory requirements, and is thread-safe. When accuracy
60 // is not needed, it is preferred over HdrSeq.
61 class BinaryMagnitudeSeq : public CHeapObj<mtGC> {
62 private:
63   size_t  _sum;
64   size_t* _mags;
65 
66 public:
67   BinaryMagnitudeSeq();
68   ~BinaryMagnitudeSeq();
69 
70   void add(size_t val);
71   size_t num() const;
72   size_t level(int level) const;
73   size_t sum() const;
74   int min_level() const;
75   int max_level() const;
< prev index next >