How to fix OutOfMemory happened with Lettuce Redis

问题描述 投票:0回答:0

我们正在使用 spring data Redis Reactive(with lettuce)。应用程序实例因 OutOfMemory 错误而冻结。对堆转储的分析表明,128 个DefaultEventExecutor 实例占用了堆空间的最大值(DefaultEventExecutor.taskQueue 包含io.lettuce.core.RedisPublisher$OnComplete 实例)。我该如何解决这个问题?

下面是线程池配置

clientConfigurationBuilder
.clientResources(ClientResources.builder().ioThreadPoolSize(128).computationThreadPoolSize(128).build())
.clientOptions(ClientOptions.builder().publishOnScheduler(true).build());

注:Spring web flux也在同一个项目中使用

spring-webflux netty lettuce spring-data-redis-reactive
© www.soinside.com 2019 - 2024. All rights reserved.