This patch should reduce the memory usage when stats are disabled.