add python memorymanagement