You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Radu Teodorescu <ra...@yahoo.com.INVALID> on 2021/06/25 21:59:25 UTC

[C++]Handling client disconnects on DoExchange (memory leak?)

Hi,
I am seeing a memory leak server side caused by calls to DoExchange:

The simples repro is having a Flight server that implements DoExchange like this
  
DoExchange(…) {
	while (true) {
		…
		reader->Next(&chunk);
		if (chunk.app_metadata == nullptr) {
			return Status::OK()
		}
	}
}


If a client initiates multiple DoExchange connections (without subsequently reading or writing anything on the associated streams) and then is killed, the server detects the disconnects and releases the threads handling DoExchange but it seems to leak 10-20MB/connection.

Before I file a bug report I want confirm I am not missing something
Thank you
Radu


Re: [C++]Handling client disconnects on DoExchange (memory leak?)

Posted by David Li <li...@apache.org>.
Hmm, something like that shouldn't leak memory and a disconnect certainly shouldn't cause the server to leak memory. A bug report would certainly be appreciated.

-David

On Fri, Jun 25, 2021, at 17:59, Radu Teodorescu wrote:
> Hi,
> I am seeing a memory leak server side caused by calls to DoExchange:
> 
> The simples repro is having a Flight server that implements DoExchange like this
>   
> DoExchange(…) {
> while (true) {
> …
> reader->Next(&chunk);
> if (chunk.app_metadata == nullptr) {
> return Status::OK()
> }
> }
> }
> 
> 
> If a client initiates multiple DoExchange connections (without subsequently reading or writing anything on the associated streams) and then is killed, the server detects the disconnects and releases the threads handling DoExchange but it seems to leak 10-20MB/connection.
> 
> Before I file a bug report I want confirm I am not missing something
> Thank you
> Radu
> 
>