re-added memory recovery for gradient to fix issue with symplectic test