@Override
    public void gc() {
        synchronized (lock) {
            // Each measurement is Object + long + float = 16 + 8 + 4 = 28 bytes
            // 12 hours with 1k nodes and 3 resources and 1 measurement/sec is about 5Gb
            for (String hostname : nodeTimeseries.keySet()) {
                var timeseries = nodeTimeseries.get(hostname);
                timeseries = timeseries.keepAfter(clock().instant().minus(Autoscaler.maxScalingWindow()));
                if (timeseries.isEmpty())
                    nodeTimeseries.remove(hostname);
                else
                    nodeTimeseries.put(hostname, timeseries);
            }
        }
    }
Lock all access for now since we modify lists inside a map
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MemoryMetricsDb.java