rsocket / rsocket-java

Java implementation of RSocket
http://rsocket.io
Apache License 2.0
2.35k stars 354 forks source link

Potential memory leak with DefaultRSocketClient not READY #1022

Closed a701440 closed 2 years ago

a701440 commented 3 years ago

RSocket version 1.1.0

I am still investigating the issue, but it appears that there may be a memory leak with DefaultRSocketClient subscribers array (ResolvingOperator.subscribers). When rsocket operations like "fireAndForget" or "requestResponse" are issued they are added to the array of subscribers (I assume waiting for the READY state). If these operations also use a timeout and are cancelled they don't seem to be removed from the subscribers array. If the client does not reach the READY state quickly (networking issues, etc) it's possible to have a pile-ip of these subscribers in the array.

heapdump
OlegDokuka commented 3 years ago

Hey, @a701440!

Can you check that issue with 1.1.1 please?

Thanks

a701440 commented 3 years ago

So far I could not reproduce in a test on both 1.1.0 and 1.1.1.

OlegDokuka commented 3 years ago

we had a bug in 1.1.0 related to the DefaultRSocketClient impl but it was fixed in 1.1.1, thus, I can only recommend migrating to 1.1.1 and let us know if this issue is still happening at your prod runtime

OlegDokuka commented 3 years ago

a bit of references -> https://github.com/rsocket/rsocket-java/pull/1008/files#diff-dc96112bec654b2fc960d08a7ca32d9d5094996ed327737679dbbcf59ce74b98L156

OlegDokuka commented 2 years ago

closing since seems to be fixed