Nonlinear oscillations in Hamiltonian PDEs