java - 升级到 10.0.1.Final 后,Infinispan 软索引文件存储出现 OutOfMemoryError

标签 java infinispan

将 Infinispan 从版本 9.4.11.Final 更新到 10.0.1.Final 后,在尝试启动第四个缓存时,启动多个缓存会产生此错误。以前的版本运行流畅。

Caused by: java.lang.RuntimeException: org.infinispan.commons.CacheConfigurationException: Error starting component org.infinispan.persistence.manager.PersistenceManager
    at com.metaproc.core.datagrid.impl.InfinispanDatagridServiceImpl.<init>(InfinispanDatagridServiceImpl.java:139) ~[?:?]
    ... 71 more
Caused by: org.infinispan.commons.CacheConfigurationException: Error starting component org.infinispan.persistence.manager.PersistenceManager
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:555) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:561) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:344) ~[?:?]
    at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:240) ~[?:?]
    at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:207) ~[?:?]
    at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:1091) ~[?:?]
    at org.infinispan.cache.impl.AbstractDelegatingCache.start(AbstractDelegatingCache.java:513) ~[?:?]
    at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:693) ~[?:?]
    at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:632) ~[?:?]
    at org.infinispan.manager.DefaultCacheManager.startCache(DefaultCacheManager.java:1024) ~[?:?]
Caused by: java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method) ~[?:?]
    at java.lang.Thread.start(Thread.java:717) ~[?:?]
    at org.infinispan.persistence.sifs.Index.start(Index.java:75) ~[?:?]
    at org.infinispan.persistence.sifs.SoftIndexFileStore.startIndex(SoftIndexFileStore.java:242) ~[?:?]
    at org.infinispan.persistence.sifs.SoftIndexFileStore.start(SoftIndexFileStore.java:161) ~[?:?]
    at org.infinispan.persistence.support.ComposedSegmentedLoadWriteStore.startNewStoreForSegment(ComposedSegmentedLoadWriteStore.java:258) ~[?:?]
    at org.infinispan.persistence.support.ComposedSegmentedLoadWriteStore.start(ComposedSegmentedLoadWriteStore.java:244) ~[?:?]
    at org.infinispan.persistence.manager.PersistenceManagerImpl.lambda$startWriter$42(PersistenceManagerImpl.java:1304) ~[?:?]
    at org.infinispan.persistence.manager.PersistenceManagerImpl.startStore(PersistenceManagerImpl.java:1333) ~[?:?]
    at org.infinispan.persistence.manager.PersistenceManagerImpl.startWriter(PersistenceManagerImpl.java:1296) ~[?:?]
    at org.infinispan.persistence.manager.PersistenceManagerImpl.lambda$start$0(PersistenceManagerImpl.java:193) ~[?:?]
    at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:?]
    at org.infinispan.persistence.manager.PersistenceManagerImpl.start(PersistenceManagerImpl.java:193) ~[?:?]
    at org.infinispan.persistence.support.DelegatingPersistenceManager.start(DelegatingPersistenceManager.java:39) ~[?:?]
    at org.infinispan.persistence.support.CorePackageImpl$1.start(CorePackageImpl.java:30) ~[?:?]
    at org.infinispan.persistence.support.CorePackageImpl$1.start(CorePackageImpl.java:24) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.invokeStart(BasicComponentRegistryImpl.java:587) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.invokeStart(BasicComponentRegistryImpl.java:584) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:578) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:561) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:605) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:569) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:547) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30) ~[?:?]
    at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:770) ~[?:?]
    at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:344) ~[?:?]
    at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:240) ~[?:?]
    at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:207) ~[?:?]
    at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:1091) ~[?:?]
    at org.infinispan.cache.impl.AbstractDelegatingCache.start(AbstractDelegatingCache.java:513) ~[?:?]
    at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:693) ~[?:?]
    at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:632) ~[?:?]
    at org.infinispan.manager.DefaultCacheManager.startCache(DefaultCacheManager.java:1024) ~[?:?]

我们正在使用此配置:

final SoftIndexFileStoreConfigurationBuilder persistentStoreConfiguration =
        new SoftIndexFileStoreConfigurationBuilder(configurationBuilder)
            .indexLocation(indexPath)
            .dataLocation(dataPath)
            .maxNodeSize(8192)
            .fetchPersistentState(true);

new ConfigurationBuilder()
    .locking()
    .isolationLevel(IsolationLevel.REPEATABLE_READ)
    .lockAcquisitionTimeout(30000)
    .useLockStriping(false)
    .transaction()
    .autoCommit(true)
    .completedTxTimeout(60000)
    .lockingMode(LockingMode.OPTIMISTIC)
    .transactionMode(TransactionMode.TRANSACTIONAL)
    .notifications(true)
    .reaperWakeUpInterval(30000)
    .cacheStopTimeout(30000)
    .transactionManagerLookup(new GenericTransactionManagerLookup())
    .clustering()
    .cacheMode(CacheMode.DIST_SYNC)
    .stateTransfer()
    .fetchInMemoryState(true)
    .hash().numOwners(2)
    .l1()
    .lifespan(-1)
    .memory()
    .size(1)
    .persistence()
    .passivation(true)
.addStore(persistentStoreConfiguration).build();

看起来软索引文件存储的某些配置不再正确,我只是不知道它可能是什么。我尝试减小 maxNodeSize,但没有成功。有人可以指出我升级后需要调整配置的部分还是还有什么我遗漏的吗?

最佳答案

我非常确定这是由 SoftIndexFileStore 被分段并创建一堆额外线程引起的。应该有一条警告消息记录到您的控制台输出中,说明该程度的内容。

您还可以在 Upgrading Guide 阅读相关内容.

您可以通过在 xml 配置中设置 segmented="false" 属性来显式定义不进行分段的商店。由于您使用的是编程配置,因此只需将 .segmented(false) 添加到您的代码中。 Source Reference

关于java - 升级到 10.0.1.Final 后,Infinispan 软索引文件存储出现 OutOfMemoryError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59190663/

相关文章:

java - java中的批处理代码

java - 成功将 HTTP POST 200 发送至 FCM,但 Android 应用程序上没有通知

java - 这段代码是否符合 Java 中的蒯因?

java - infinispan 中的自定义哈希函数

java - 如何在全局配置中设置传输以定义集群缓存 - infinispan

java - 我想以编程方式向我的 android 按钮添加多个字符串(不是通过 XML)

java - 无法使用 JSch 和 JDK 8 打开 ssh session

java - 由于 SearchFactoryIntegrator 不在注册表中,无法在 JBoss 7 上查询 Infinispan

java - 无法将 infinispan 升级到 9.1.0.Final : ClassCastException

java - 具有复合主键的 Hibernate 实体的 Infinispan 编码错误