@Override
  public Object getValueInVM(RegionEntryContext context) {
    ReferenceCountHelper.createReferenceCountOwner();
    @Released
    Object v = getValueRetain(context, true);

    if (v == null) {
      // should only be possible if disk entry
      v = Token.NOT_AVAILABLE;
    }
    Object result = OffHeapHelper.copyAndReleaseIfNeeded(v, context.getCache());
    ReferenceCountHelper.setReferenceCountOwner(null);
    return result;
  }
This method determines if the value is compressible and compresses it if it is.

@param context the values context.
@param value a region entry value.

@return the compressed form of the value parameter.
geode-core/src/main/java/org/apache/geode/internal/cache/entries/AbstractRegionEntry.java