类 MemoryLimitCalculator
- java.lang.Object
-
- org.apache.dubbo.common.threadpool.MemoryLimitCalculator
-
public class MemoryLimitCalculator extends Object
Runtime.freeMemory()technology is used to calculate the memory limit by using the percentage of the current maximum available memory, which can be used withMemoryLimiter.
-
-
构造器概要
构造器 构造器 说明 MemoryLimitCalculator()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static longcalculate(float percentage)Take the current JVM's maximum available memory as a percentage of the result as the limit.static longdefaultLimit()By default, it takes 80% of the maximum available memory of the current JVM.static longmaxAvailable()Get the maximum available memory of the current JVM.
-
-
-
方法详细资料
-
maxAvailable
public static long maxAvailable()
Get the maximum available memory of the current JVM.- 返回:
- maximum available memory
-
calculate
public static long calculate(float percentage)
Take the current JVM's maximum available memory as a percentage of the result as the limit.- 参数:
percentage- percentage- 返回:
- available memory
-
defaultLimit
public static long defaultLimit()
By default, it takes 80% of the maximum available memory of the current JVM.- 返回:
- available memory
-
-