BUG: accept memory=None