core/src/main/java/com/orientechnologies/orient/core/storage/cache/chm/FrequencySketch.java
@Override
  public void increment(int hash) {
    hash = spread(hash);
    final int start = (hash & 3) << 2;

    // Loop unrolling improves throughput by 5m ops/s
    final int index0 = indexOf(hash, 0);
    final int index1 = indexOf(hash, 1);
    final int index2 = indexOf(hash, 2);
    final int index3 = indexOf(hash, 3);

    boolean added = incrementAt(index0, start);
    added |= incrementAt(index1, start + 1);
    added |= incrementAt(index2, start + 2);
    added |= incrementAt(index3, start + 3);

    if (added && (++size == sampleSize)) {
      reset();
    }
  }
@Override
  public void increment(int hash) {
    hash = spread(hash);
    final int start = (hash & 3) << 2;

    // Loop unrolling improves throughput by 5m ops/s
    final int index0 = indexOf(hash, 0);
    final int index1 = indexOf(hash, 1);
    final int index2 = indexOf(hash, 2);
    final int index3 = indexOf(hash, 3);

    boolean added = incrementAt(index0, start);
    added |= incrementAt(index1, start + 1);
    added |= incrementAt(index2, start + 2);
    added |= incrementAt(index3, start + 3);

    if (added && (++size == sampleSize)) {
      reset();
    }
  }
Increments the popularity of the element if it does not exceed the maximum (15). The popularity
of all elements will be periodically down sampled when the observed events exceeds a threshold.
This process provides a frequency aging to allow expired long term entries to fade away.

@param hash the hash code of element