use of org.apache.asterix.common.config.StorageProperties in project asterixdb by apache.
the class NCApplication method getCapacity.
@Override
public NodeCapacity getCapacity() {
StorageProperties storageProperties = runtimeContext.getStorageProperties();
// Deducts the reserved buffer cache size and memory component size from the maxium heap size,
// and deducts one core for processing heartbeats.
long memorySize = Runtime.getRuntime().maxMemory() - storageProperties.getBufferCacheSize() - storageProperties.getMemoryComponentGlobalBudget();
int allCores = Runtime.getRuntime().availableProcessors();
int maximumCoresForComputation = allCores > 1 ? allCores - 1 : allCores;
return new NodeCapacity(memorySize, maximumCoresForComputation);
}
Aggregations