# Memory checks
# ============================================
include common.cfg
# Base definition for memory relative checks
# (i.e. checks with a base value). Should
# not be used directly
Use = relative_base($0,$1)
Unit = B
# Relative Heap Memory used by the application. This
# is the ratio between used heap memory and the maximal
# available heap memory
# $0: Critical value (optional)
# $1: Warning value (optional)
Use = memory_relative_base($0,$1)
Value = java.lang:type=Memory/HeapMemoryUsage/used
Base = java.lang:type=Memory/HeapMemoryUsage/max
Label = Heap-Memory: $BASE
Name = Heap
# Relative non-heap memory. The JVM has memory other than the heap,
# referred to as non-heap memory. It stores per-class structures such
# as runtime constant pool, field and method data, and the code for
# methods and constructors, as well as interned Strings. More detailed
# information can be obtained from the pool checks defined below
# $0: Critical value (optional)
# $1: Warning value (optional)
Use = memory_relative_base
Value = java.lang:type=Memory/NonHeapMemoryUsage/used
Base = java.lang:type=Memory/NonHeapMemoryUsage/max
Label = Non-Heap-Memory: $BASE
Name = Non-Heap
# =============================================================
# Memory pool checks. These are specific to a Sun/Oracle JVM.
# Base definition for pool based checks
# $0: Label prefix and name to used
# $1: Critical value (optional)
# $2: Warning value (optional)
Use = memory_relative_base($1,$2)
Value = java.lang:type=MemoryPool,name=$0/Usage/used
Base = java.lang:type=MemoryPool,name=$0/Usage/max
Label = $0 : $BASE
Name = $0
# Base definition for garbage collection count
# This checks count the number of garbage collections per
# minute
# $0: Name of garbage collector (used as Label as well)
# $1: Critical value (default: 30)
# $2: Warning value (default: 20)
Use = count_per_minute("GC count")
Value = java.lang:type=GarbageCollector,name=$0/CollectionCount
Label = $0 : $BASE
Name = $0 count
Critical = 30
Warning = 20
# Base definition for garbage time measurements
# This checks measure the time (in ms) garbage collections take per
# minute
# $0: Name of garbage collector (used as Label as well)
# $1: Critical value (default: 200000)
# $2: Warning value (default: 10000)
Use = count_per_minute("GC ms")
Value = java.lang:type=GarbageCollector,name=$0/CollectionTime
Label = $0 : $BASE
Name = $0 time
Critical = ${1:20000}
Warning = ${2:10000}
# The paralled garbage collectors and memory
# pools switched on with -XX:+UseParallelGC.
# Used by 64bit server VMs by default.
Check = memory_pool_base("PS Eden Space",100,100)
Check = memory_pool_base("PS Survivor Space",100,100)
Check = memory_pool_base("PS Old Gen")
Check = memory_pool_base("PS Perm Gen")
Check = memory_gc_count_base("PS Scavenge")
Check = memory_gc_count_base("PS MarkSweep")
Check = memory_gc_time_base("PS Scavenge")
Check = memory_gc_time_base("PS MarkSweep")
# Garbage collectors and memory pools used for
# -XX:+UseConcMarkSweepGC and -XX:+UseParNewGC
# used by default by OS X, client vm.
Check = memory_pool_base("Par Eden Space")
Check = memory_pool_base("Par Survivor Space")
Check = memory_pool_base("CMS Old Gen")
Check = memory_pool_base("CMS Perm Gen")
Check = memory_gc_count_base("ParNew")
Check = memory_gc_count_base("ConcurrentMarkSweep")
Check = memory_gc_time_base("ParNew")
Check = memory_gc_time_base("ConcurrentMarkSweep")
# Garbage collector and memory pools used
# when -XX:+UseSerialGC is used. Seems to be the default
# on linux for -client and -server VMs
Check = memory_pool_base("Eden Space")
Check = memory_pool_base("Survivor Space")
Check = memory_pool_base("Tenured Gen")
Check = memory_pool_base("Perm Gen")
Check = memory_gc_count_base("Copy")
Check = memory_gc_count_base("MarkSweepCompact")
Check = memory_gc_time_base("Copy")
Check = memory_gc_time_base("MarkSweepCompact")
Use = memory_pool_base("Code Cache")
# ================================================
# Collection of related checks.
# Overall view to the memory statistics
Check memory_heap
Check memory_non_heap