must record memory allocate every step because of strong gc