If each Fourier mode of the equilibrium radiation in an otherwise empty cavity with perfectly reflective walls is considered as a degree of freedom capable of exchanging energy, then, according to the equipartition theorem of classical physics, there would be an equal amount of energy in each mode. Since there are an infinite number of modes this implies infinite heat capacity (infinite energy at any non-zero temperature), as well as an unphysical spectrum of emitted radiation that grows without bound with increasing frequency, a problem known as the ultraviolet catastrophe. Instead, in quantum theory the occupation numbers of the modes are quantized, cutting off the spectrum at high frequency in agreement with experimental observation and resolving the catastrophe.