If I use a loop inside a function and stop it with break, does it remove the function from Ram memory?

ok, I run a function with Task.Spawn and in that function there is a cycle and at a certain point it stops the cycle with break, and does not continue until Task.Spawn is used again in the function, does it clear the memory?