开启Redis服务器闪退问题

Redis点击redis-server.exe开启Redis服务器闪退问题

在IDEA使用Jedis的第三方jar包,运行时报redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool这个错误,这句话的意思是不能从Redis池中获取连接,发生这个错误有两个原因,一是Redis的服务器没有开启,二是连接池满了,不能获取连接。

我遇到的问题是Redis不能开启的问题,点击Redis.exe闪一下就没了;我们可以查看一下原因,win+R输入cmd命令进入控制台;
进入Redis的安装目录

输入redis-server.exe命令
结果报以下错误了:[12472] 03 Sep 15:19:01.950 # QForkMasterInit: system error caught. error code=0x000005af, message=VirtualAllocEx failed.: unknown error

因是内存分配的问题。解决方法有两个,第一:启动的时候使用--maxmemory 命令限制Redis的内存:

redis-server redis.windows.conf --maxmemory 200m

然后完美运行了

第二种方法就是修改配置文件redis.windows.conf :

maxmemory 209715200

之后再运行redis-server redis.windows.conf 就可以启动了:

posted @ 2019-09-18 20:01  Larva_我在呢  阅读(3422)  评论(0编辑  收藏  举报