  Here, we study the large-time limit of viscosity solutions of the Cauchy
problem for second-order Hamilton--Jacobi--Bellman equations with convex
Hamiltonians in the torus. This large-time limit solves the corresponding
stationary problem, sometimes called the ergodic problem. This problem,
however, has multiple viscosity solutions and, thus, a key question is which of
these solutions is selected by the limit. Here, we provide a representation for
the viscosity solution to the Cauchy problem in terms of generalized holonomic
measures. Then, we use this representation to characterize the large-time limit
in terms of the initial data and generalized Mather measures. In addition, we
establish various results on generalized Mather measures and duality theorems
that are of independent interest.
