void refCountChanged(Long address, boolean decRefCount, int rc) {
    if (!trackReferenceCounts()) {
      return;
    }

    final Object owner = refCountOwner.get();
    if (owner == SKIP_REF_COUNT_TRACKING) {
      return;
    }

    List<RefCountChangeInfo> list = stacktraces.get(address);

    if (list == null) {
      refCountChangedTestHook(address, decRefCount, rc);

      List<RefCountChangeInfo> newList = new ArrayList<>();
      List<RefCountChangeInfo> old = stacktraces.putIfAbsent(address, newList);
      if (old == null) {
        list = newList;
      } else {
        list = old;
      }
    }

    if (decRefCount) {
      if (owner != null) {
        synchronized (list) {
          for (int i = 0; i < list.size(); i++) {
            RefCountChangeInfo info = list.get(i);
            if (owner instanceof RegionEntry) {
              if (owner == info.getOwner()) {
                if (info.getUseCount() > 0) {
                  info.decUseCount();
                } else {
                  list.remove(i);
                }
                return;
              }
            } else if (owner.equals(info.getOwner())) {
              if (info.getUseCount() > 0) {
                info.decUseCount();
              } else {
                list.remove(i);
              }
              return;
            }
          }
        }
      }
    }

    if (list == LOCKED) {
      String message = "refCount " + (decRefCount ? "deced" : "inced")
          + " after orphan detected for @" + Long.toHexString(address);
      debugLogger.accept(message, true);
      return;
    }

    RefCountChangeInfo refCountChangeInfo = new RefCountChangeInfo(decRefCount, rc, owner);

    synchronized (list) {
      for (RefCountChangeInfo otherRefCountChangeInfo : list) {
        if (otherRefCountChangeInfo.isSameCaller(refCountChangeInfo)) {
          // No need to add it just increment useCount
          otherRefCountChangeInfo.incUseCount();
          return;
        }
      }
      list.add(refCountChangeInfo);
    }
  }
Used internally to report that a reference count has changed.
geode-core/src/main/java/org/apache/geode/internal/offheap/ReferenceCountHelperImpl.java