note: I find this question In stackexchange math, I would be interest to know how I could be answer this kind of question,I pasted it here as I see it appropriate For MO.
check this link: https://math.stackexchange.com/q/1030616/156150.
Let $(M,g)$ be a compact Riemannian manifold.
Is there an example of a geodesic $c:\mathbb{R}\to M$ s.t. $c(\mathbb{R})$ is compact, $c$ is NOT periodic (i.e. be NOT a closed geodesic) ?
I would be interest for any replies or any comments .Thank you