Avalanche mechanics in gradient elasticity