We study the onset of bubble formation (cavitation) in the quark-gluon plasma as a result of the reduction of the effective pressure from bulk-viscous corrections. By calculating velocity gradients in typical models for quark-gluon plasma evolution in heavy-ion collisions, we obtain results for the critical bulk viscosity above which cavitation occurs. Since present experimental data for heavy-ion collision seems inconsistent with the presence of bubbles above the phase transition temperature of QCD, our results may be interpreted as an upper limit of the bulk viscosity in nature. Our results indicate that bubble formation is consistent with the expectation of hadronisation in low-temperature QCD