Class MemoryThresholdThrottling

java.lang.Object
org.jppf.node.throttling.MemoryThresholdThrottling
All Implemented Interfaces:
JPPFNodeThrottling

public class MemoryThresholdThrottling extends Object implements 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 (false by 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, after acceptsNewJobs(Node) returns false a configured consecutive number of times. The corresponding configuration property is set as jppf.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 Details

    • MemoryThresholdThrottling

      public MemoryThresholdThrottling()
      Default constructor.
  • Method Details

    • acceptsNewJobs

      public boolean acceptsNewJobs(org.jppf.node.Node node)
      Description copied from interface: JPPFNodeThrottling
      Determine whether the node accepts new jobs.
      Specified by:
      acceptsNewJobs in interface JPPFNodeThrottling
      Parameters:
      node - the node to which the throttling applies.
      Returns:
      true if the node accepts new jobs, false otherwise.