Netty4ClientHttpRequestFactory always allocates "maxRequestSize" bytes for each request [SPR-12623] #17224
There are two inter-related issues here:
-Way to solve this would be to add a separate maxResponseSize parameter and use it in HttpObjectAggregator.-
This can easily cause OOM errors - but it's not a leak, it's just an abusive use of memory.
The issue is here:
The method used allocates always the max capacity:
Instead, this allocation method should be used:
I set this bug as critical because, with current status, the client is unusable for any meaningful load.
Aside from this, it'd be great if it was possible to provide the memory allocator, instead of using always the static Unpooled one...
Reference URL: #719
Rossen Stoyanchev commented
The maxRequestSize property is now deprecated as of 4.1.5 and is already removed in master for 4.2. While still present in 4.1.5 I've made sure it's used as expected, i.e.
Meanwhile a new maxResponseSize property has been added that limits the size of the response through HttpObjectAggregator(maxResponseSize).