The short circuiting renormalizer used with ML anomaly detection will skip renormalizations if a more recent set of quantiles has been received.  It does this by maintaining a queue of quantiles documents, but when it is ready to perform the next renormalization it drains the entire queue so that it is left with the most recent.  When quantiles documents are large this is an inefficient use of memory.  Instead of storing the full quantiles documents in a queue it should just retain the most recently added quantiles document.
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/ShortCircuitingRenormalizer.java
private static final Logger LOGGER = LogManager.getLogger(ShortCircuitingRenormalizer.class);
    private final String jobId;
    private final ScoresUpdater scoresUpdater;
    private final ExecutorService executorService;
    private final Deque<QuantilesWithLatch> quantilesDeque = new ConcurrentLinkedDeque<>();
    private final Deque<CountDownLatch> latchDeque = new ConcurrentLinkedDeque<>();
    /**
     * Each job may only have 1 normalization in progress at any time; the semaphore enforces this
     */
    private final Semaphore semaphore = new Semaphore(1);
    public ShortCircuitingRenormalizer(String jobId, ScoresUpdater scoresUpdater, ExecutorService executorService) {
        this.jobId = jobId;
        this.scoresUpdater = scoresUpdater;
        this.executorService = executorService;
    }
    @Override
    public boolean isEnabled() {
        return scoresUpdater.getNormalizationWindow() > 0;
    }
    @Override
    public void renormalize(Quantiles quantiles) {
        if (isEnabled() == false) {
            return;
        }
        
        QuantilesWithLatch quantilesWithLatch = new QuantilesWithLatch(quantiles, new CountDownLatch(1));
        
        synchronized (quantilesDeque) {
            
            latchDeque.addLast(quantilesWithLatch.getLatch());