APM Java Agent and Ehcache object reference limit

Hello, we are using the Elastic Stack 7.16.2 for Logging and APM. We have instrumented our Java application with the Elastic APM Java Agent, which has been working well and lead to many insights.

Recently the following message appears in our Logs:

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.

This is logged by net.sf.ehcache.pool.sizeof.ObjectGraphWalker from thread elastic-apm-shared about every 30 seconds.

Is there something we need to configure to get rid of this message?

Or can we safely drop this message in our ingest pipeline?

Thanks
Jochen

Hi @wdw-jst ,

The agent does not directly interact with ehcache, thus there must be an indirect call that triggers this message.

Given you get it every 30s, it seems very likely to be related to metrics gathered by the agent that are sampled and sent every 30s by default.

Thus I'm guessing that you might have some metrics gathered by JMX configuration that trigger this ehcache behavior, and there is nothing the agent can really do about it.

So, dropping this from the ingest pipeline might be an option to ignore it, but maybe investing some time to fix the underlying issue might also be a good idea. Also, if there is a way to make ObjectGraphWalker ignore all the agent threads, that would also be relevant here.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.