diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c
index 3def7e3bd1c06ba27259b5e3d0a343181f9b0c26..ccf4be27b4f0ee851b4c9d4df34c093384e21d9f 100644
--- a/src/sdl/i_system.c
+++ b/src/sdl/i_system.c
@@ -3239,7 +3239,13 @@ size_t I_GetFreeMem(size_t *total)
 #else
 	// Guess 48 MB.
 	if (total)
+	{
+#if SDL_VERSION_ATLEAST(2,0,1)
+		*total = SDL_GetSystemRAM();
+#else
 		*total = 48<<20;
+#endif
+	}
 	return 48<<20;
 #endif
 }