  For $\Omega \subset \mathbb{R}^n$, a convex and bounded domain, we study the
spectrum of $-\Delta_\Omega$ the Dirichlet Laplacian on $\Omega$. For
$\Lambda\geq0$ and $\gamma \geq 0$ let $\Omega_{\Lambda, \gamma}(\mathcal{A})$
denote any extremal set of the shape optimization problem $$
  \sup\{ \mathrm{Tr}(-\Delta_\Omega-\Lambda)_-^\gamma: \Omega \in \mathcal{A},
|\Omega|=1\}, $$ where $\mathcal{A}$ is an admissible family of convex domains
in $\mathbb{R}^n$. If $\gamma \geq 1$ and $\{\Lambda_j\}_{j\geq1}$ is a
positive sequence tending to infinity we prove that $\{\Omega_{\Lambda_j,
\gamma}(\mathcal{A})\}_{j\geq1}$ is a bounded sequence, and hence contains a
convergent subsequence. Under an additional assumption on $\mathcal{A}$ we
characterize the possible limits of such subsequences as minimizers of the
perimeter among domains in $\mathcal{A}$ of unit measure. For instance if
$\mathcal{A}$ is the set of all convex polygons with no more than $m$ faces,
then $\Omega_{\Lambda, \gamma}$ converges, up to rotation and translation, to
the regular $m$-gon.
  This is a revised version of the paper published in the Journal of Spectral
Theory (2019) which has been updated in accordance with an erratum published in
2021. The results of the paper remain unchanged, but the proofs of Theorem 2.4
and Corollary 5.3 have been amended.
