Memory consumption in loops

shape