How to release memory when scene replace in cocosd2d-x 3.2

Are you using pushScene() etc? I recently had the same issue and it was related to attempting to getting back to the main menu scene from the pause menu of my game.