fixed memory leak error for initializeMass and SpaceJacobians