File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/state Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ private Collection<T> collectWithDeltaAggregationTemporality() {
247247 List <T > deltaPoints = memoryMode == REUSABLE_DATA ? reusablePointsList : new ArrayList <>();
248248 currentPoints .forEach (
249249 (attributes , currentPoint ) -> {
250- T lastPoint = lastPoints .get (attributes );
250+ T lastPoint = lastPoints .remove (attributes );
251251
252252 T deltaPoint ;
253253 if (lastPoint == null ) {
@@ -272,9 +272,9 @@ private Collection<T> collectWithDeltaAggregationTemporality() {
272272 });
273273
274274 if (memoryMode == REUSABLE_DATA ) {
275- // lastPoints for the current collection can be discarded when the collection is completed.
276- // They can be returned to the pool because they're not managed by the AggregatorHandle,
277- // we made a copy.
275+ // - If the point was used to compute a delta, it's now in deltaPoints (and thus in
276+ // reusablePointsList)
277+ // - If the point hasn't been used, it's still in lastPoints and can be returned
278278 lastPoints .forEach (pointReleaser );
279279 lastPoints .clear ();
280280
You can’t perform that action at this time.
0 commit comments