diff --git a/src/memtest.c b/src/memtest.c index 089f497c..cf83557d 100644 --- a/src/memtest.c +++ b/src/memtest.c @@ -267,7 +267,11 @@ void memtest_test(size_t megabytes, int passes) { memtest_progress_end(); memtest_compare_times(m,bytes,pass,4); } +#ifdef _WIN32 + VirtualFreeEx(GetCurrentProcess(), m, 0, MEM_RELEASE); +#else free(m); +#endif } void memtest_non_destructive_invert(void *addr, size_t size) { diff --git a/src/redis.c b/src/redis.c index af43cb10..bbf97521 100644 --- a/src/redis.c +++ b/src/redis.c @@ -3672,7 +3672,7 @@ int main(int argc, char **argv) { strcmp(argv[1], "-h") == 0) usage(); if (strcmp(argv[1], "--test-memory") == 0) { if (argc == 3) { - memtest(atoi(argv[2]),50); + memtest(atoi(argv[2]), IF_WIN32(5, 50)); exit(0); } else { fprintf(stderr,"Please specify the amount of memory to test in megabytes.\n");