public int getLocalMaxMemoryDefault() { if (!this.enableOffHeapMemory) { return PartitionAttributesFactory.LOCAL_MAX_MEMORY_DEFAULT; } long availableOffHeapMemoryInMB = 0; if (InternalDistributedSystem.getAnyInstance() == null) { return USE_CALCULATED_VALUE; } else { String offHeapSizeConfigValue = InternalDistributedSystem.getAnyInstance().getOriginalConfig().getOffHeapMemorySize(); availableOffHeapMemoryInMB = OffHeapStorage.parseOffHeapMemorySize(offHeapSizeConfigValue) / (1024 * 1024); } if (availableOffHeapMemoryInMB == 0) { throw new IllegalStateException("No off-heap memory has been configured."); } if (availableOffHeapMemoryInMB > Integer.MAX_VALUE) { LogService.logger().warning(LocalizedStrings.PartitionAttributesImpl_REDUCED_LOCAL_MAX_MEMORY_FOR_PARTITION_ATTRIBUTES_WHEN_SETTING_FROM_AVAILABLE_OFF_HEAP_MEMORY_SIZE); availableOffHeapMemoryInMB= Integer.MAX_VALUE; } return (int) availableOffHeapMemoryInMB; } }
/** * By default the partition can use up to 100% of the allocated off-heap * memory. */ private int computeOffHeapLocalMaxMemory() { long availableOffHeapMemoryInMB = 0; if (testAvailableOffHeapMemory != null) { availableOffHeapMemoryInMB = OffHeapStorage.parseOffHeapMemorySize(testAvailableOffHeapMemory) / (1024 * 1024); } else if (InternalDistributedSystem.getAnyInstance() == null) { this.localMaxMemoryExists = false; return OFF_HEAP_LOCAL_MAX_MEMORY_PLACEHOLDER; // fix 52033: return non-negative, non-zero temporary placeholder for offHeapLocalMaxMemory } else { String offHeapSizeConfigValue = InternalDistributedSystem.getAnyInstance().getOriginalConfig().getOffHeapMemorySize(); availableOffHeapMemoryInMB = OffHeapStorage.parseOffHeapMemorySize(offHeapSizeConfigValue) / (1024 * 1024); } if (availableOffHeapMemoryInMB > Integer.MAX_VALUE) { logger.warn(LocalizedMessage.create(LocalizedStrings.PartitionAttributesImpl_REDUCED_LOCAL_MAX_MEMORY_FOR_PARTITION_ATTRIBUTES_WHEN_SETTING_FROM_AVAILABLE_OFF_HEAP_MEMORY_SIZE)); return Integer.MAX_VALUE; } this.localMaxMemoryExists = true; return (int) availableOffHeapMemoryInMB; }
memberInfo.setLocators(config.getLocators()); memberInfo.setServerBindAddress(serverBindAddress); memberInfo.setOffHeapMemorySize(config.getOffHeapMemorySize());
final long offHeapMemorySize = OffHeapStorage.parseOffHeapMemorySize(getConfig().getOffHeapMemorySize());
String offHeapMemorySize = System.getProperty("gemfire."+DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME); if(offHeapMemorySize == null || offHeapMemorySize.trim().equals("")) { offHeapMemorySize = Misc.getGemFireCache().getDistributedSystem().getConfig().getOffHeapMemorySize();
String offHeapMemorySize = System.getProperty("gemfire."+DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME); if(offHeapMemorySize == null || offHeapMemorySize.trim().equals("")) { offHeapMemorySize = Misc.getGemFireCache().getDistributedSystem().getConfig().getOffHeapMemorySize();
String offHeapMemorySize = System.getProperty("gemfire."+DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME); if(offHeapMemorySize == null || offHeapMemorySize.trim().equals("")) { offHeapMemorySize = Misc.getGemFireCache().getDistributedSystem().getConfig().getOffHeapMemorySize();
final long offHeapMemorySize = OffHeapStorage.parseOffHeapMemorySize(getConfig().getOffHeapMemorySize());
this.offHeapMemorySize = other.getOffHeapMemorySize();
this.offHeapMemorySize = other.getOffHeapMemorySize();