【现象】
如果存储在Cache中的信息太多,会输出以下日志。
-------------------
The configured limit of 1,000 object references was reached while attempting to calculate the size of the object graph.
Severe performance degradation could occur if the sizing operation continues.
This can be avoided by setting the CacheManger or Cache <sizeOfPolicy> elements maxDepthExceededBehavior to "abort" or adding stop points with @IgnoreSizeOf annotations.
If performance degradation is NOT an issue at the configured limit, raise the limit value using the CacheManager or Cache <sizeOfPolicy> elements maxDepth attribute.
For more information, see the Ehcache configuration documentation.
-------------------
【原因】
为了管理缓存大小,EHCache会计算保存在缓存中的内容的大小。
此时,如果存在的对象有默认设置的1000个及以上的参照时,就会发生这种情况。
这可能会成为由于计算大小导致性能降低的原因。
【回避方法】
通过使用max-elements-on-memory来代替max-bytes-memory,
可以让警告不再输出。
例如,因为许可策略设置缓存的存储数量增加而导致发生此现象时,
将conf/im-ehcache-config/authz-policy.xml 的 max-bytes-memory更改为 max-elements-on-memory,
则此现象将被抑制。
但是,在不使用max-bytes-memory,而使用max-elements-on-memory的情况下,
有可能就不会根据缓存数量来清理缓存,且会占用大量的堆空间。
请将max-elements-on-memory中指定的值作为对象条件(Subject组别)的数量。
有关每个Subject组别的堆的使用量,请参阅以下“策略设置缓存”的“缓存大小的计算公式”。
https://www.intra-mart.jp/document/library/iap/public/im_authz/im_authz_specification/texts/appendix/im_ehcache_sizing.html
另外,可以通过sizeOfPolicy项目来控制ECHCache的设置,
但是一般的缓存机构通常没有这些设置,因此不提供从外部更改设置值的方法。
今后,我们会考虑提供从外部传递sizeOfPolicy设置的机制。
-- 适用对象 ----------------------------------------------------------------
iAP/AccelPlatform/所有版本
--------------------------------------------------------------------------------
FAQID:16
system.log中输出以下大量的警告。有抑制的方法吗?------------------- The configured limit of1,000object references was reached while attempting to calculate the size of the object graph. Severe performance degradation could occur if the sizing operation co