Self-pulsing nanocavity laser