Open raycon opened 2 years ago
setting("maxmemory 128M")
// https://github.com/kstyrc/embedded-redis/issues/51#issuecomment-318221233 @Configuration @Profile("test") public class EmbeddedRedisServer { @Value("${spring.redis.port:6380}") private int redisPort; private RedisServer redisServer; @PostConstruct public void startRedis() throws IOException, URISyntaxException { //redisPort = org.springframework.util.SocketUtils.findAvailableTcpPort(6380); //RedisExecProvider customRedisExec = RedisExecProvider.defaultProvider().override // (OsArchitecture.detect().os(), OsArchitecture.detect().arch(), "redis-server-2.8.19.exe"); redisServer = RedisServer.builder() .port(redisPort) //.redisExecProvider(customRedisExec) //com.github.kstyrc (not com.orange.redis-embedded) .setting("maxmemory 128M") //maxheap 128M .build(); redisServer.start(); } @PreDestroy public void stopRedis() throws InterruptedException { if (redisServer != null) { redisServer.stop(); } } }
setting("maxmemory 128M")
코드를 추가함