flush redis before max memory is reached; hotfix for #49