点燃报告IgniteOutOfMemoryException : Out of memory in data region

标签 ignite

我基于apache ignite core jar 2.7.0构建缓存集群,服务器进程因OOM错误退出:

org.apache.ignite.logger.java.JavaLogger.error JVM will be halted immediately due to the failure: [failureCtx=FailureContext [type=CRITICAL_ERROR, err=class o.a.i.i.mem.IgniteOutOfMemoryException: Out of memory in data region [name=keywordRegion, initSize=256.0 MiB, maxSize=8.0 GiB, persistenceEnabled=false] Try the following:
  ^-- Increase maximum off-heap memory size (DataRegionConfiguration.maxSize)
  ^-- Enable Ignite persistence (DataRegionConfiguration.persistenceEnabled)
  ^-- Enable eviction or expiration policies]]

区域配置为:

<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
    <property name="name" value="keywordRegion"/>
    <property name="maxSize" value="#{1024L * 1024 * 1024 * 8}"/>
    <property name="pageEvictionMode" value="RANDOM_2_LRU"/>
    <property name="persistenceEnabled" value="false"/>
</bean>

关于错误日志中给出的3条建议:

  1. 我想将缓存大小限制为8g;
  2. 我只想使用内存缓存;
  3. PageEvictionMode 设置为 RANDOM_2_LRU;

我测试了一些情况,当缓存值大小相同时,驱逐效果很好,当它们是随机大小时,会导致 OOM。 什么事?是不是配置错误了?谢谢。

编辑: 这是我的测试,最大区域大小设置为120M,OOM发生在第200次循环左右,当mega声明行移到for循环前面时,ignite工作良好。

IgniteCache<String, Object> keywordCache = ignite.getOrCreateCache("keyword");
    for(int i=0;i<1000;i++){
        int mega = new Random().nextInt(3) + 1;
        keywordCache.put(UUID.randomUUID().toString(), new byte[mega * 1024 * 1024]);
        System.out.println("current:"+i);
    }

最佳答案

这些对象比 EvictionPolicy 中的emptyPagesPoolSize的默认属性大,因此,它可能会导致这种行为。您可以将此行添加到 DataRegionConfiguration:

<property name="emptyPagesPoolSize" value="5000"/>

我检查了您的再现器,它在应用此属性后可以正常工作。

关于点燃报告IgniteOutOfMemoryException : Out of memory in data region,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55937768/

相关文章:

java - Ignite 扫描查询抛出类 org.apache.ignite.binary.BinaryInvalidTypeException

java - 刷新网页时 Apache ignite 出现错误

启动硬盘中的数据备份

java - 根据要求使用已投入使用的 Spring Boot 启动 ignite

java - 如何将经过身份验证的 WebSession 存储在分布式内存缓存中

javascript - Apache ignite jdbc 连接凭据

java - 如何在 Apache Ignite 中获取已逐出的项目

ignite - Apache Ignite 近缓存可以在堆外吗?

java - 点燃缓存事务强制回滚

java - KAFKA 与现代内存内存数据网格 (IMDG) 相比