`
付星烨
  • 浏览: 7123 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表
清超出的缓存的代码在这里: net.sf.ehcache.store.chm.SelectableConcurrentHashMap 第五百行 int runs = Math.min(MAX_EVICTION, SelectableConcurrentHashMap.this.quickSize() - (int) SelectableConcurrentHashMap.this.maxSize);                         while (runs-- > 0) {                             Element evict = ...
参数: overflowToDisk="true"  当为true时会持久化到硬盘,并非超出内存最大数时才会 diskPersistent="true"  当为false时,manager.shutdown()时会清空硬盘文件,下次启动时不会读取。为true时,manager.shutdown()时会保留硬盘文件 ...
随便写写,当是记录了。 集群有两种方式,一是配置上你要同步的ip+port。这样在同步列表里就有了这此地址。 第二种方式是广播来自动发现。 <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,multicastGroupPort=4446, timeToLiv ...
首先说一下ehcache的好处。 ehcache是本机缓存,而非memcache是远程缓存,ehcache的缓存是在当前jvm里的,这使得内存是可重用的。所以其性能是远过memcache的。 1、免去了远程IO时间。 2、免去了memcache这种取回来以后要申请内存的时间。 3、大大差少了full gc的次数。 ehcache的缓存方式与cuncurrentHashmap相似,一系列segment,每个segment里有一个hashmap这种。 下面介绍正题,它的缓存失效机制。我会在最下面贴出我的配置。 一、网上说,这个玩意他有一个后台的守护线程,在不定时的清理缓存。还说设 ...
Global site tag (gtag.js) - Google Analytics