Total stability and classical Hamiltonian theory