setting maxmemory automatically.