private void initializeResourceManager() {
    // Get current eviction and critical heap percentages
    ResourceManager rm = getCache().getResourceManager();
    float currentEvictionHeapPercentage = rm.getEvictionHeapPercentage();
    float currentCriticalHeapPercentage = rm.getCriticalHeapPercentage();

    // Set new eviction and critical heap percentages if necessary
    if (getEvictionHeapPercentage() != currentEvictionHeapPercentage
        || getCriticalHeapPercentage() != currentCriticalHeapPercentage) {
      if (getLogger().isDebugEnabled()) {
        StringBuilder builder = new StringBuilder();
        builder.append("Previous eviction heap percentage=").append(currentEvictionHeapPercentage)
            .append("; critical heap percentage=").append(currentCriticalHeapPercentage);
        getLogger().debug(builder.toString());
        builder.setLength(0);
        builder.append("Requested eviction heap percentage=").append(getEvictionHeapPercentage())
            .append("; critical heap percentage=").append(getCriticalHeapPercentage());
        getLogger().debug(builder.toString());
      }
      if (currentCriticalHeapPercentage == 0.0f) {
        // If the current critical heap percentage is 0 (disabled), set eviction
        // heap percentage first, then set the critical heap percentage. At this
        // point, the eviction heap percentage can be set to anything.
        try {
          rm.setEvictionHeapPercentage(getEvictionHeapPercentage());
          rm.setCriticalHeapPercentage(getCriticalHeapPercentage());
        } catch (IllegalArgumentException e) {
          handleResourceManagerException(e, currentEvictionHeapPercentage,
              currentCriticalHeapPercentage);
          rm.setEvictionHeapPercentage(currentEvictionHeapPercentage);
          rm.setCriticalHeapPercentage(currentCriticalHeapPercentage);
        }
      } else if (getCriticalHeapPercentage() >= currentCriticalHeapPercentage) {
        // If the requested critical heap percentage is >= the current critical
        // heap percentage, then set the critical heap percentage first since it
        // can safely be slid up. Then, set the eviction heap percentage.
        try {
          rm.setCriticalHeapPercentage(getCriticalHeapPercentage());
          rm.setEvictionHeapPercentage(getEvictionHeapPercentage());
        } catch (IllegalArgumentException e) {
          handleResourceManagerException(e, currentEvictionHeapPercentage,
              currentCriticalHeapPercentage);
          rm.setCriticalHeapPercentage(currentCriticalHeapPercentage);
          rm.setEvictionHeapPercentage(currentEvictionHeapPercentage);
        }
      } else {
        // If the requested critical heap percentage is < the current critical
        // heap percentage, then set the eviction heap percentage first since it
        // can safely be slid down. Then, set the critical heap percentage.
        try {
          rm.setEvictionHeapPercentage(getEvictionHeapPercentage());
          rm.setCriticalHeapPercentage(getCriticalHeapPercentage());
        } catch (IllegalArgumentException e) {
          handleResourceManagerException(e, currentEvictionHeapPercentage,
              currentCriticalHeapPercentage);
          rm.setEvictionHeapPercentage(currentEvictionHeapPercentage);
          rm.setCriticalHeapPercentage(currentCriticalHeapPercentage);
        }
      }
      if (getLogger().isDebugEnabled()) {
        String builder = "Actual eviction heap percentage=" + rm.getEvictionHeapPercentage()
            + "; critical heap percentage=" + rm.getCriticalHeapPercentage();
        getLogger().debug(builder);
      }
    }

    // Validate java startup parameters after setting the eviction and
    // critical heap percentages so that they can be compared against them.
    ResourceManagerValidator.validateJavaStartupParameters(getCache());
  }
Instance reference which is set in static initialization blocks of any subclasses.
extensions/geode-modules/src/main/java/org/apache/geode/modules/session/bootstrap/AbstractCache.java