Add memory management.