0
我正在使用Hibernate 4.3.11.Final随附的ehcache版本。我有一个简单的缓存配置,它看起来像以下:垃圾收集将如何影响存储在堆上的ehcache元素?
<defaultCache maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="86400"
timeToLiveSeconds="86400"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU">
</defaultCache>
<cache name="main" />
我的问题是,由于内存设置为堆的一部分,堆得垃圾定期收集,会发生什么,当一些条目在我的缓存收集垃圾?这些条目是否与缓存中的条目相同?
对吗?这家伙乞求不同 - http://stackoverflow.com/questions/24346428/garbage-collection-when-ehcache-is-used-for-hibernate-second-level-cache。另外,如果他们没有被GC收集,为什么Terracotta觉得有必要解决这个不存在的“垃圾收集问题” - http://www.theserverside.com/news/thread.tss?thread_id=60893 。 – Dave
谢谢你的clariciation。虽然我没有提到堆外,但您提出这是一个有趣的解决方案,以解决ehcache的onheap系统的缺点。但是ehcache的offheap解决方案不是免费的,对吧? – Dave
版本2.x的权利,但即将推出的版本3是免费的。请参阅ehcache.org –