Many windows user run the radis server as a service,but when it does not start with error message "The redis service on local computer started and then stopped. Some services stop automatically if they are not in use by other servies or programs.' Things go bad.

 

The best way to know the error is to start redis-server.exe from command prompt.Locate your redis installation (usually C:\Program Files\Redis ) and open the command prompt with that directory as current directory. then Run redis-server.exe by typing it on the prompt. Once done you could get some hint at the command prompt about the problem, my problem was the following.

C:\Program Files\Redis>redis-server.exe

[7972] 11 Jan 14:38:51.171 #

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.

Looks like my windows box do not have enough virtual memory, thus it creates problem for me. So I had to change the the page size / virtual memory ( I had recently changed the settings ) to get back what is the default. Please follow the windows link http://windows.microsoft.com/en-in/windows/change-virtual-memory-size#1TC=windows-7 for changing the virtual memory settings ( there are safe defaults ) so nothing to worry while setting, but having it to set too low the problem may still persists, to set the right value please refer your redis.windows.conf file in your redis installation directory. You may have to restart your windows machine, in order see the effect.