dubbo
dubbo copied to clipboard
Why not empty the FutureContext?
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
Ask your question here
java version: 1.8 dubbo version: 2.7.12
I have a dubbo service and it named "main". main service set 500 for provider->threads, so 500 threads to choose from main service when main service called by a dubbo customer.However main service going to call another dubbo service, and it get some results successfully and there results have large size. I look Dubbo put the result to FutureContext(tips: The relevant code is at org.apache.dubbo.rpc.protocol.AbstractInvoker.java:193), but it not be emptied never. This leads that my part of app memory isn't recycled, i.e 500 threads will hold own FutureContext, and every FutureContext will have the large obeject. My app is OOM.

FutureContext is used after invoke to get result from Dubbo, which means Dubbo have no time to clear it. You can try update to 3.0.11, which will do not set FutureContext if the invocation is not in async mode.