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 with MemoryLimiter.MemoryLimiter,
MemoryLimitCalculator| Constructor and Description |
|---|
MemoryLimitCalculator() |
| Modifier and Type | Method and Description |
|---|---|
static long |
calculate(float percentage)
Take the current JVM's maximum available memory
as a percentage of the result as the limit.
|
static long |
defaultLimit()
By default, it takes 80% of the maximum available memory of the current JVM.
|
static long |
maxAvailable()
Get the maximum available memory of the current JVM.
|
public static long maxAvailable()
public static long calculate(float percentage)
percentage - percentagepublic static long defaultLimit()
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.