在Windows上启动Redis失败

时间:2016-06-01 20:07:15

标签: windows redis redis-windows

我正在尝试在Windows 10上启动Redis。当我运行redis-server.exe时,我收到以下消息:

C:\Program Files\Redis>redis-server.exe
[4680] 01 Jun 19:57:30.844 #
The Windows version of Redis allocates a memory mapped heap for sharing with
the forked process used for persistence operations. In order to share this
memory, Windows allocates from the system paging file a portion equal to the
size of the Redis heap. At this time there is insufficient contiguous free
space available in the system paging file for this operation (Windows error
0x5AF). To work around this you may either increase the size of the system
paging file, or decrease the size of the Redis heap with the --maxheap flag.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.

Please see the documentation included with the binary distributions for more
details on the --maxheap flag.

Redis can not continue. Exiting.

我尝试添加--maxheap值,但这会导致应用程序崩溃并打印出崩溃转储:

C:\Program Files\Redis>redis-server.exe  --maxheap 150
[6728] 01 Jun 19:57:41.063 #

=== REDIS BUG REPORT START: Cut & paste starting from here ===
[6728] 01 Jun 19:57:41.063 # Redis version: 2.8.2400
[6728] 01 Jun 19:57:41.063 # Out Of Memory allocating 16 bytes.
[6728] 01 Jun 19:57:41.094 # --- ABORT
[6728] 01 Jun 19:57:41.094 # --- STACK TRACE
redis-server.exe!LogStackTrace(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:95)(0x00000016, 0x00001C1D, 0x00000000, 0x00000001)
redis-server.exe!AbortHandler(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:207)(0x00000001, 0xA222916F, 0x00000000, 0xDA31C9A7)
redis-server.exe!raise(f:\dd\vctools\crt\crtw32\misc\winsig.c:587)(0x00000001, 0x00000000, 0x00000010, 0x00000018)
redis-server.exe!abort(f:\dd\vctools\crt\crtw32\misc\abort.c:82)(0xFFE97BC0, 0x40141940, 0x00000010, 0x00000000)
redis-server.exe!redisOutOfMemoryHandler(c:\release\redis\src\redis.c:3404)(0x00000000, 0x4013FC28, 0x00001C1D, 0x0014FB80)
redis-server.exe!createSharedObjects(c:\release\redis\src\redis.c:1326)(0x4013BD44, 0x00000000, 0x00000001, 0x00000001)
redis-server.exe!initServer(c:\release\redis\src\redis.c:1733)(0x4013BD44, 0x4013BD44, 0x00000000, 0x4013BD44)
redis-server.exe!redis_main(c:\release\redis\src\redis.c:3504)(0x00490470, 0x00000000, 0x574F3E35, 0x00000000)
redis-server.exe!main(c:\release\redis\src\win32_interop\win32_qfork.cpp:1338)(0x00000000, 0x00000000, 0x00000000, 0x0034F000)
redis-server.exe!__tmainCRTStartup(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0x00000000, 0x400344CC, 0x00000000, 0x00000000)
KERNEL32.DLL!BaseThreadInitThunk(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0xD9E580E0, 0x00000000, 0x00000000, 0x00000000)
ntdll.dll!RtlUserThreadStart(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
ntdll.dll!RtlUserThreadStart(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
[6728] 01 Jun 19:57:41.172 #
=== REDIS BUG REPORT END. Make sure to include from START to END. ===

       Please report this bug by following the instructions at:

     http://github.com/MSOpenTech/redis/wiki/Submitting-an-Issue

    Suspect RAM error? Use redis-server --test-memory to verify it.

我已尝试使用崩溃转储结束时建议的其余内存选项运行,但这只会给我带来与运行可执行文件时相同的错误:

C:\Program Files\Redis>redis-server.exe  --test-memory
[756] 01 Jun 19:58:34.376 #
The Windows version of Redis allocates a memory mapped heap for sharing with
the forked process used for persistence operations. In order to share this
memory, Windows allocates from the system paging file a portion equal to the
size of the Redis heap. At this time there is insufficient contiguous free
space available in the system paging file for this operation (Windows error
0x5AF). To work around this you may either increase the size of the system
paging file, or decrease the size of the Redis heap with the --maxheap flag.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.

Please see the documentation included with the binary distributions for more
details on the --maxheap flag.

Redis can not continue. Exiting.

我有14Gb的内存,所以我发现很难相信这是一个内存问题。

1 个答案:

答案 0 :(得分:1)

经过一段时间的Google-ing后找到答案:https://gist.github.com/anthavio/38d0ba4c916ab1911a47

不是使用--maxheap选项(似乎什么都不做),而是将值添加到配置中:

maxheap 1000000000