Version spring-boot version 3.3.1 spring-webflux 6.1.10

Description In one of our applications, we are facing OutOfMemory error. We think, that it is connected with Webflux and the upload files using HTTP Multipart requests.

We managed to create a small project with the test, that is able to reproduce issue: LEAK: ByteBuf.release() was not called before it's garbage-collected.

The project can be found here: https://github.com/bugs84/webflux-leak-02

Basically, there is a controller that accepts multipart and saves it into the files.

   @PostMapping("/upload-files10")
    fun uploadFileWithoutEntity(@RequestPart("files", required = false) filePartFlux: Flux<Part>): Mono<*> {
        return filePartFlux.collectList().flatMap { fileList: List<Part> ->
            Flux.fromIterable(fileList).flatMapSequential { file: Part ->
                val destination = Paths.get("generated_${fileNumber++}.file")
                DataBufferUtils.write(file.content(), destination).then(Mono.just("ok"))
            }.then(Mono.just("OK"))
        }
    }

If we run the test it should generate the mentioned LEAK: issue.