Merge "Schedule trimMemory after drawing the frame" into pi-dev