zoukankan      html  css  js  c++  java
  • redis堆外内存溢出bug

    当进行压力测试时后期后出现堆外内存溢出OutOfDirectMemoryError

    产生原因:

    1)、springboot2.0以后默认使用lettuce作为操作redis的客户端,它使用netty进行网络通信

    2)、lettuce的bug导致netty堆外内存溢出。netty如果没有指定堆外内存,默认使用Xms的值,可以使用-Dio.netty.maxDirectMemory进行设置

    解决方案:由于是lettuce的bug造成,不能直接使用-Dio.netty.maxDirectMemory去调大虚拟机堆外内存,治标不治本。

    1)、升级lettuce客户端。但是没有解决的
    2)、切换使用jedis

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-redis</artifactId>
        <exclusions>
            <exclusion>
                <groupId>io.lettuce</groupId>
                <artifactId>lettuce-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>redis.clients</groupId>
        <artifactId>jedis</artifactId>
    </dependency>
    

      

  • 相关阅读:
    水木清华小爬虫
    不让复制是不可能的----js获取选中文字
    [转]nonlocal和global
    LLVM和clang
    Megcup2017 Dogfood
    史莱姆自爆问题
    前端颜色表
    [转]论文十诫
    返利网盈利模式
    事务的四个属性ACID
  • 原文地址:https://www.cnblogs.com/vincentmax/p/14479930.html
Copyright © 2011-2022 走看看