2016 Elsevier Ltd A liquid subjected to negative pressure is thermodynamically metastable. Confined within a small volume, negative pressure can build up until cavities form spontaneously. The critical negative pressure for cavitation in water has been theoretically predicted to be in the range of 100 to 200 MPa at room temperature, whereas values around 30 MPa have been obtained by many experiments. The discrepancy has yet to be resolved. In this study we perform molecular dynamics simulations to study cavitation of water under volume controlled stretching. It is found that liquid water exhibits a nonlinear elastic compressibility (or stretchability) under hydrostatic tension and remains stable within the confined volume until spontaneous cavitation occurs at a critical strain. Subsequently, as the volume-controlled stretching continues, the cavity grows stably and the hydrostatic tension decreases continuously until the box volume is large enough for another transition to form a water droplet. A modified nucleation theory is proposed to predict the critical condition for cavitation. In particular, a strong dependence of the critical strain and stress for cavitation on the initial liquid volume is predicted by the modified nucleation theory, which may offer a possible explanation for the discrepancies in the values of the critical negative pressure obtained from experiments.