Package org.jppf.node.throttling
Class MemoryThresholdThrottling
java.lang.Object
org.jppf.node.throttling.MemoryThresholdThrottling
- All Implemented Interfaces:
JPPFNodeThrottling
A throttling mechanism that causes a node to not accept jobs whenever heap usage reaches a configured percentage of the maximum heap size. It can be configured with the following properties:
- it can be activated by setting the node configuration property
jppf.node.throttling.memory.threshold.active = true(falseby default) - the threshold can be set as a percentage of the maximum heap size with the node configuration property
jppf.node.throttling.memory.threshold = 87.5(90% by default) - it can also call
System.gc(), in an attempt to mitigate the high heap usage, afteracceptsNewJobs(Node)returnsfalsea configured consecutive number of times. The corresponding configuration property is set asjppf.node.throttling.memory.threshold.maxNbTimesFalse = 2(3 by default)
Example configuration:
# activate the throttling plugin jppf.node.throttling.memory.threshold.active = true # % of maximum heap size that causes the node to refuse jobs jppf.node.throttling.memory.threshold = 87.5 # number of times the check returns false before invoking System.gc() jppf.node.throttling.memory.threshold.maxNbTimesFalse = 5
- Since:
- 6.1
- Author:
- Laurent Cohen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsNewJobs(org.jppf.node.Node node) Determine whether the node accepts new jobs.
-
Constructor Details
-
MemoryThresholdThrottling
public MemoryThresholdThrottling()Default constructor.
-
-
Method Details
-
acceptsNewJobs
public boolean acceptsNewJobs(org.jppf.node.Node node) Description copied from interface:JPPFNodeThrottlingDetermine whether the node accepts new jobs.- Specified by:
acceptsNewJobsin interfaceJPPFNodeThrottling- Parameters:
node- the node to which the throttling applies.- Returns:
trueif the node accepts new jobs,falseotherwise.
-