You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Matthias J. Sax (Jira)" <ji...@apache.org> on 2023/04/04 05:10:00 UTC

[jira] [Resolved] (KAFKA-14864) Memory leak in KStreamWindowAggregate with ON_WINDOW_CLOSE emit strategy

     [ https://issues.apache.org/jira/browse/KAFKA-14864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias J. Sax resolved KAFKA-14864.
-------------------------------------
    Fix Version/s: 3.4.1
                   3.3.3
       Resolution: Fixed

> Memory leak in KStreamWindowAggregate with ON_WINDOW_CLOSE emit strategy
> ------------------------------------------------------------------------
>
>                 Key: KAFKA-14864
>                 URL: https://issues.apache.org/jira/browse/KAFKA-14864
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 3.4.0, 3.3.2
>            Reporter: Victoria Xia
>            Assignee: Victoria Xia
>            Priority: Major
>             Fix For: 3.5.0, 3.4.1, 3.3.3
>
>
> The Streams DSL processor implementation for the ON_WINDOW_CLOSE emit strategy during KStream windowed aggregations opens a key-value iterator but does not call `close()` on it ([link|https://github.com/apache/kafka/blob/5afedd9ac37c4d740f47867cfd31eaed15dc542f/streams/src/main/java/org/apache/kafka/streams/kstream/internals/AbstractKStreamTimeWindowAggregateProcessor.java#L203]), despite the Javadocs for the iterator making clear that users must do so in order to release resources ([link|https://github.com/apache/kafka/blob/5afedd9ac37c4d740f47867cfd31eaed15dc542f/streams/src/main/java/org/apache/kafka/streams/state/KeyValueIterator.java#L27]).  
> I discovered this bug while running load testing benchmarks and noticed that some runs were sporadically hitting OOMs, so it is definitely possible to hit this in practice.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)