Back-and-forth oscillations of a container filled with fluid often result in spilling as the gravest mode gets excited, a well-known phenomenon experienced in everyday life and of particular importance in industry. Our understanding of sloshing is largely restricted to linear response, and existing extensions mostly focus on nonlinear coupling between modes. Linear theory is expected to correctly model the dynamics of the system as long as the amplitude of the mode remains small compared to another length scale, so far unknown. Using a fluid in the vicinity of its critical point, we demonstrate that in perfect wetting this length scale is neither the wavelength nor the capillary length but a much shorter one, the thickness of the boundary layer. Above this crossover length scale, the resonance frequency remains roughly constant while dissipation significantly increases. We also show that dynamical wetting is involved in both linear and nonlinear dissipative processes.