Managing memory consumption when you use the hosted transparent decision service
Using the hosted transparent decision service (HTDS) REST API with JSON parameters might cause a memory leak. You can prevent this issue by setting up a configuration parameter in the web.xml file for HTDS.
Symptoms
Using the HTDS REST API with JSON parameters might cause a memory leak.Resolving the problem
Choose one of the following configuration options.Option 1 is recommended in most cases. However, you might need to select a different option or threshold depending on the usage and the number of rulesets that are concurrently executed.
Activating the following options does not impact the execution itself, although it might impact the performance of certain executions when their values are not present in the cache.
Option 1: Setting the ResetJsonMapperXomClassloaderInstancesThreshold parameter
Define the number of classloaders to be cached after the cache is flushed.
Expected value:
long
If an invalid long
value is provided, the threshold
will not be defined and the cache will not be reset, which means that it falls back to the default
behavior.
- Add the following lines to set this parameter in the web.xml file for
HTDS:
<context-param> <param-name>ResetJsonMapperXomClassloaderInstancesThreshold</param-name> <param-value>10</param-value> </context-param>
- To define this threshold with a Java system property, use the following
syntax:
-Dcom.ibm.rules.htds.resetJsonMapperXomClassloaderInstancesThreshold=10
- To define this threshold with an environment variable, use the following
syntax:
RESET_JSON_MAPPER_XOM_CLASSLOADER_INSTANCES_THRESHOLD =10
Option 2: Setting the ResetJsonMapperHtdsCallsThreshold parameter
Define the number of HTDS calls after the cache is flushed.
Expected value:
long
If an invalid long
value is provided, the threshold
will not be defined and the cache will not be reset, which means that it falls back to the default
behavior.
- Add the following lines to set this parameter in the web.xml file for
HTDS:
<context-param> <param-name>ResetJsonMapperHtdsCallsThreshold</param-name> <param-value>50</param-value> </context-param>
- To define this threshold with a Java system property, use the following
syntax:
-Dcom.ibm.rules.htds.resetJsonMapperHtdsCallsThreshold=50
- To define this threshold with an environment variable, use the following
syntax:
RESET_JSON_MAPPER_HTDS_CALLS_THRESHOLD=50
Option 3: Setting the ResetJsonMapperElapsedHoursThreshold parameter
Define an elapsed time threshold (in hours) after the cache is flushed.
Expected value: double
If an invalid double
value is provided, the threshold will not be defined and the cache will not be reset, which means
that it falls back to the default behavior.
- Add the following lines to set this parameter in the web.xml file for
HTDS:
<context-param> <param-name>ResetJsonMapperElapsedHoursThreshold</param-name> <param-value>0.5</param-value> </context-param>
- To define this threshold with a Java system property, use the following
syntax:
-Dcom.ibm.rules.htds.resetJsonMapperElapsedHoursThreshold=0.5
- To define this threshold with an environment variable, use the following
syntax:
RESET_JSON_MAPPER_ELAPSED_HOURS_THRESHOLD=0.5