A symplectic Lie algebra [Formula: see text] is called Ricci-flat if [Formula: see text], where [Formula: see text] denotes its Killing form and [Formula: see text] its unimodularity vector defined by [Formula: see text]. A symplectic Lie algebra [Formula: see text] is called flat if its natural symplectic product, i.e. [Formula: see text] is left-symmetric. In this paper, we investigate the Ricci-flatness property of two important classes of symplectic Lie algebras: almost-abelian symplectic Lie algebras and Novikov symplectic Lie algebras. We first prove that an almost-abelian or Novikov symplectic Lie algebra is flat if and only if it is 2-step nilpotent. Then we provide necessary and sufficient conditions for almost-abelian and Novikov symplectic Lie algebras to be Ricci-flat. Finally, we characterize Ricci-flat symplectic Lie algebras that are both almost-abelian and Novikov by proving that they are precisely the flat ones.