Efficient online calculation of quantiles with low memory overhead