Class MemoryCircuitBreaker


  • public class MemoryCircuitBreaker
    extends CircuitBreaker
    Tracks the current JVM heap usage and triggers if it exceeds the defined percentage of the maximum heap size allocated to the JVM. This circuit breaker is a part of the default CircuitBreakerManager so is checked for every request -- hence it is realtime. Once the memory usage goes below the threshold, it will start allowing queries again.

    The memory threshold is defined as a percentage of the maximum memory allocated -- see memoryCircuitBreakerThresholdPct in solrconfig.xml.

    • Method Detail

      • calculateLiveMemoryUsage

        protected long calculateLiveMemoryUsage()
        Calculate the live memory usage for the system. This method has package visibility to allow using for testing.
        Returns:
        Memory usage in bytes.