Gradient flows of non convex functionals in Hilbert spaces and applications