  Let $M$ be a smooth compact manifold of dimension $d$ without boundary. We
introduce the concept of predominance for Riemannian metrics on $M$, a notion
analogous to full Lebesgue measure which, in particular, implies density. We
show that for a predominant metric, the number of closed geodesics of length
smaller than $T$ has a stretched exponential upper bound in $T$.
  In addition, we study remainders in the Weyl law for predominant metrics. The
Weyl law states that the number of Laplace-Beltrami eigenvalues smaller than
$\lambda^2$ is asymptotic to $C\lambda^d$ with an $O(\lambda^{d-1})$ error. We
show that, for a predominant metric, the estimate on the error can by improved
by a power of $\log \lambda$. After an application of recent results of the
authors in the case of the Weyl law, these estimates follow from a study of the
non-degeneracy properties of nearly closed orbits for predominant sets of
metrics.
