Wall-collision broadening of near-infrared absorption lines of molecular oxygen confined in nanoporous zirconia is studied by employing high-resolution diode-laser spectroscopy. The broadening is studied for pores of different sizes under a range of pressures, providing new insights on how wall collisions and intermolecular collisions influence the total spectroscopic line profile. The pressure series show that wall-collision broadening is relatively more prominent under reduced pressures, enabling sensitive means to probe pore sizes of porous materials. In addition, we show that the total wall-collision-broadened profile strongly deviates from a Voigt profile and that wall-collision broadening exhibits an additive-like behavior to the pressure and Doppler broadening. © 2011 American Physical Society.