sap: Properly manage object memory.