停止方法是否真的从内存中删除了缓存条目?
我正在维护基于Infinispan 9.4.24的旧Java代码,并以不记忆的例外终止。 该代码启动了680个线程,每个线程每个线程每秒接收一个2 Byte数据并将其插入缓存。一小时后,线程使用停止方法停止缓存,并为其重新创建新的缓存。 不幸的是,在1Gbyte的JVM中执行2或3个小时后,该代码会获得OutofMemory例外。 我尝试使用驱逐配置(请参见下文),但没有解决问题:
new ConfigurationBuilder().memory()
.storageType(StorageType.BINARY).evictionType(EvictionType.COUNT)
.evictionStrategy(EvictionStrategy.REMOVE).size(1000)
.persistence().addSingleFileStore().location(cachesRootLocation)
.purgeOnStartup(false).build();
我尝试直接从高速缓存映射中删除条目,但它确实不起作用,得到了以下例外的例外: 我尝试了有效期和寿命配置,但由于我没有配置群集模式: .expiration() 。
通常,我有一个IllegallifecyClestateException例外,表明在使用驱逐并调用驱逐方法或在停止之后或之前删除MAP条目时,缓存处于停止或终止状态。
有人可以告诉我,停止方法是否真的可以从内存中删除缓存条目?有人可以帮我吗?如何在没有例外的情况下从缓存中删除条目?
我可以看到,我可以看到,大多数内存都被默认的datacontainer Instancies所占据。
感谢您的帮助。
I'm maintaining an old java code that is based on Infinispan 9.4.24 and terminates by an out of memory exception.
The code launches 680 threads where each thread receives each second a 2byte data and inserts it in a cache. After one hour, the thread stoppes the cache with the stop method, and recreate a new cache for it.
Unfortunately, after 2 or 3 hours of execution in a jvm of 1Gbyte, the code gets an outofmemory exception.
I tried to use eviction configuration (see below) but it didn't solve the problem :
new ConfigurationBuilder().memory()
.storageType(StorageType.BINARY).evictionType(EvictionType.COUNT)
.evictionStrategy(EvictionStrategy.REMOVE).size(1000)
.persistence().addSingleFileStore().location(cachesRootLocation)
.purgeOnStartup(false).build();
I tried removing entries directly from the cache map, but it does'nt work, getting on exceptions like :
I tried expiration and lifespan configuration, but it didn't work as i am not configuring cluster mode :
.expiration()
.lifespan(3600, TimeUnit.SECONDS)
I disabled passivation while using the evict method, but no solution.
Usually, i have an IllegalLifecycleStateException exception telling that cache is in stopping or terminated state, when using eviction and calling the evict method or remove map entries after or before stop.
Can anybody tells me if the stop method really removes cache entries from memory please ? Can anybody help me please ? How to remove entries from cache without getting exceptions ?
Using a profiler (jdump and MAT tools), i can see that most of memory is occupied by DefaultDataContainer instancies.
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论