Control how deep the size-of engine can go when sizing on-heap elements by adding the following element at the CacheManager level:<sizeOfPolicy maxDepth="<value>" maxDepthExceededBehavior="<value>"/>
This element has the following attributes
- maxDepth – Controls how many linked objects can be visited before the size-of engine takes any action. This attribute is required.
- maxDepthExceededBehavior – Specifies what happens when the max depth is exceeded while sizing an object graph:
- "continue" – DEFAULT Forces the size-of engine to log a warning and continue the sizing operation. If this attribute is not specified, "continue" is the behavior used.
- "abort" – Forces the SizeOf engine to abort the sizing, log a warning, and mark the cache as not correctly tracking memory usage. With this setting, Ehcache.hasAbortedSizeOf() returns true.
Add the above element to the following files: