The behavior of variational procedures for bound states is well understood, when using harmonic oscillator wave functions whose frequency ω is the only parameter. The same procedure, when applied to problems that have resonant states, shows a completely different behavior. By analyzing the s-wave problem for a cavity potential of the form b′δ(r′−a), we show that, as a function of ω, it gives rise to plateaus that correspond to the real part of the resonant energies, assuming values of b′ related to very narrow resonances compared with their separations. If the latter condition holds, the procedure seems generalizable to other types of potentials.