I've got a particular cache of metadata that contains very large objects (32.7MB for a single entry in heap). This cache is extremely expensive to flush out and fault back into L1, and performance actually seems worse on BigMemory Max 4.0.0 than it was on Terracotta open source 3.7.2. I've tried pinning the cache to local memory like this:
Code:
<cache name="categoryTree" maxEntriesInCache="50"
timeToLiveSeconds="604800">
<pinning store="localMemory" />
<terracotta>
<nonstop immediateTimeout="true">
<timeoutBehavior type="noop" />
</nonstop>
</terracotta>
</cache>
The issue I'm seeing is that once L1 fills up, I still see this cache getting faulted in from L2. I would think that ehcache should prefer to evict other stuff from L1 that isn't pinned, but that doesn't appear to be happening. I also get the warning about object depth in the logs whenever this cache gets faulted in from L2, like this:
terracotta-client.log:
Code:
2013-04-23 10:49:00,129 [http-bio-8080-exec-107] WARN com.tc.net.core.TCConnection -
Warning: Attempting to send a message (com.tc.net.protocol.delivery.OOOProtocolMessageImpl) of size 9201445 bytes
terracotta-server.log:
Code:
2013-04-23 10:48:58,583 [WorkerThread(apply_changes_stage, 5, 5)] WARN com.tc.object.dna.impl.BaseDNAEncodingImpl -
Attempt to read a byte array of len: 9200950; threshold=8000000
tomcat.log:
Code:
2013-04-23 10:49:01,355 [WorkerThread(local_cache_transaction_complete_stage, 2, 0)] WARN .pool.sizeof.ObjectGraphWalker -
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.
Is there any good way to deal with large/deep objects when using BigMemory Max?