压力测试时产生堆外内存溢出:OutOfDirectMemoryError
lettuce
作为操作 redis 的客户端,它使用 netty
进行通信-Xmx300m
:如果没有指定堆外内存,netty 默认使用 堆内存(Xmx)
作为 堆外内存<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
不能使用 -Dio.netty.maxDirectMemory 只调大堆外内存
<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>
springboot整合redis报错:OutOfDirectMemoryError
原文:https://www.cnblogs.com/cnbai/p/13603879.html