Closed
Description
At line 127 of spring-core/src/main/java/org/springframework/core/codec/StringDecoder.java at the main branch, you have
.doOnTerminate(chunks::releaseAndClear)
But chunks won't be released and cleared upon cancellation according to javadoc of reactor-core's reactor.core.publisher.Flux.doOnTerminate():
Add behavior (side-effect) triggered when the Flux terminates, either by completing successfully or failing with an error.
I suggest that you fix this potential memory leak by replacing doOnTerminate() by doFinally() because doFinally() Add behavior (side-effect) triggered after the Flux terminates for any reason, including cancellation.