Tuomo Ala-Vannesluoma
Tuomo Ala-Vannesluoma
I think we are seeing direct memory leak when using this workaround (and eventually throwing out of direct memory). After removing our filter for caching request body the direct memory...
It looks like `ServerWebExchangeUtils.cacheRequestBody` is creating composite `DataBuffer` which seems to be not released correctly. I guess netty will release the original buffer when connection is closed but this composite...
> @tuomoa I used your workaround, but the memory still leaks. @FrankChen021 Interesting. We are not seeing memory leak after doing pretty much the fix proposed above. Have you been...
> @tuomoa In my case, your method also memory leak. What is your filter order? @FrankChen021 @tianshuang @lsh1358046425 Our WebFilter has `@Order(Ordered.HIGHEST_PRECEDENCE + 2)` It's been quite a while when...
> @tuomoa @spencergibb The difference is that I cache body used to get MultipartData. I using your latest code, memory is still leaking. I still hope that the official can...
> In fact, Gateway has provided global `org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter` to perform cleaning operations, which has the highest priority, and theoretically we do not need to manually clean up. Yeap. But like...
@tianshuang Did you get it working by overriding the `getMultipartData()` similarly as we did with the `getFormData()` in the decorator?
There is discussion about this in https://github.com/spring-cloud/spring-cloud-gateway/issues/1587. You should probably also use `RemoveCachedBodyFilter` in your use case.
See #1587
If I remember correctly I tried it with both filenames, but with the other GitLab did not even try to show the results. I'm afraid I don't have the file...