The discovery of a "weakly-turbulent" instability of anti-de Sitter spacetime supports the idea that confined fluctuations eventually collapse to black holes and suggests that similar phenomena might be possible in asymptotically-flat spacetime, for example in the context of spherically symmetric oscillations of stars or nonradial pulsations of ultracompact objects. Here we present a detailed study of the evolution of the Einstein-Klein-Gordon system in a cavity, with different types of deformations of the spectrum, including a mass term for the scalar and Neumann conditions at the boundary. We provide numerical evidence that gravitational collapse always occurs, at least for amplitudes that are three orders of magnitude smaller than Choptuik's critical value and corresponding to more than 10 5 reflections before collapse. The collapse time scales as the inverse square of the initial amplitude in the small-amplitude limit. In addition, we find that fields with nonresonant spectrum collapse earlier than in the fully-resonant case, a result that is at odds with the current understanding of the process. Energy is transferred through a direct cascade to high frequencies when the spectrum is resonant, but we observe both direct-and inverse-cascade effects for nonresonant spectra. Our results indicate that a fully-resonant spectrum might not be a crucial ingredient of the conjectured turbulent instability and that other mechanisms might be relevant. We discuss how a definitive answer to this problem is essentially impossible within the present framework.