Enabling and Configuring the System Monitor Service
The System Monitor service, which monitors state of the Java virtual machine (JVM), is disabled by default. You can enable the service to poll the state of the JVM at a certain interval and capture stack and heap dumps when memory utilization increases beyond a specified threshold. This topic provides instructions for enabling the service and configuring its options.
Enabling the System Monitor Service
Follow the steps below to enable the System Monitor.
- In the Administration application, expand the Servers menu and click Advanced Configuration. Click I understand and accept the risk.
- Search for the Anzo System Monitor bundle and view its details.
- Click the Services tab and expand System Monitor Activator.
- Locate the com.cambridgesemantics.anzo.system.monitor.monitorSystem property (shown in the image below).
- Click the property to make it editable, and then select the checkbox to enable it.
- Click the checkmark icon () for that property to save the change.
- Next, configure the service to dump the stack and/or heap logs to disk by enabling the properties under the monitorSystem property:
To create heap dumps, enable com.cambridgesemantics.anzo.system.monitor.produceHeap. To create stack dumps, enable com.cambridgesemantics.anzo.system.monitor.produceStack.
- You can restart Anzo to enable the service without performing additional configuration. Or see Configuring the System Monitor Service below for information about the configuration options.
Configuring the System Monitor Service
By default, the System Monitor Service is configured to monitor memory usage and take the following actions:
- Every 60 seconds (60000 milliseconds), evaluate whether a stack or thread dump should be written.
- Write stack and/or heap dumps if the memory threshold reaches 85% (0.85).
- Continue to write stack and/or heap dumps at an interval of every 10 minutes (600000 milliseconds) as long as memory usage remains at or above the threshold.
- Save heap and stack dumps in the
<install_path>/Server/logs/system_monitor/heap
andstack
directories.
To modify the characteristics described above, you can change the values for the following properties:
- To change the frequency with which memory usage is evaluated to see if it has reached the threshold, update the com.cambridgesemantics.anzo.system.monitor.monitorDelay property. Specify the number of milliseconds to wait between checks.
- To change the memory threshold, update the com.cambridgesemantics.anzo.system.monitor.memoryThreshold property. Specify the percent of total memory as a decimal value.
- To change how often stack and/or heap dumps are written when memory usage is above the threshold, update the com.cambridgesemantics.anzo.system.monitor.dumpFrequency property. Specify the number of milliseconds to wait between dumps.
- To change the location where heap and/or stack dumps are saved, update the com.cambridgesemantics.anzo.system.monitor.heapLocation and/or com.cambridgesemantics.anzo.system.monitor.stackLocation property to specify an alternate path and directory.
After changing any of the properties, make sure that you restart Anzo to apply the configuration change.