We investigate wave collapse ruled by the generalized nonlinear Schrödinger (NLS) equation in 1+1 dimensions, for localized excitations with non-zero background, establishing through virial identities a new criterion for blow-up. When collapse is arrested, a semiclassical approach allows us to show that the system can favor the formation of dispersive shock waves. The general findings are illustrated with a model of interest to both classical and quantum physics (cubic-quintic NLS equation), demonstrating a radically novel scenario of instability, where solitons identify a marginal condition between blow-up and occurrence of shock waves, triggered by arbitrarily small mass perturbations of different sign.