0
在我的代碼中,我使用EhCache來存儲對象。代碼如下EhCache內存限制
@Resource(name = "ehCacheManager")
private CacheManager manager;
private Ehcache cache;
public void testCache(){
cache = manager.getCache("ehSubjects");
for loop to read subjects data{ //This loops runs 15051 times
final Element element = new Element(subject.subjectId(), subject);
cache.put(element);
}
}
System.out.println("Cache Size:"+cache.getSize()); //15000
的問題是,有15051個主體對象,但是當循環之後我嘗試打印緩存大小它總是給我15000
那麼,有沒有上的對象的數量有限制我們可以保留在EhCache中?
請爲Ehcache添加任何相關的配置信息。否則難以回答。 –