Retrieving the execution unit (XU) memory usage

After you configure the XU memory profiler, you can use it to learn how much memory the execution unit uses for a ruleset.

Before you begin

Before you can retrieve information about memory usage, you must configure the memory profiler:
  1. Make sure that the rulesetUsageMonitorEnabled property is set to true (its default value). See Enabling ruleset monitoring.
  2. Install the Rule Execution Server Java™ agent.

About this task

Then, you can retrieve profiling information in either of two ways:
  • From the XU memory dump in the Rule Execution Server console: if you experience memory issues with ruleset execution, you can enable the memory profiler before you send the XU memory dump to IBM Support.
  • By using the API as explained in step 1.
Tip: When the memory profiler is enabled, execution performance might be reduced. To avoid this problem, disable the memory profiler in production mode and enable it only to investigate memory issues.

Procedure

To retrieve XU memory usage by using the API:

  1. Retrieve IlrRulesetUsageInformation objects from an instance of IlrRulesetUsageInformationMonitor.
    IlrRulesetUsageInformationMonitor monitor = ... 
    IlrRulesetUsageInformation information = monitor.getRulesetUsageInformation(rulesetPath); 

    You can retrieve IlrRulesetUsageInformationMonitor instances by using either the XU plug-in API or the custom ruleset cache API:

    • In the XU plug-in API: call the IlrDefaultPlugin.setRulesetUsageInformationMonitor method.
    • In the custom ruleset cache API: pass the IlrRulesetUsageInformationMonitor instance as a parameter to the IlrRulesetCache.initialize method.
  2. Retrieve the memory consumption of the XU for a specific ruleset by a call to the method IlrRulesetUsageInformation. getEstimatedMemorySize.