Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Cannot Reproduce
-
0.9.1
-
None
-
RHEL 6.5
Description
We are using Thrift 0.9.1 in Linux, both client and server are written in C++. TThreadedServer is used to process requests involving large (up to 1MB) binary parameters.
Usage pattern is like this: the client establishes a UNIX socket connection, makes some interface calls and then disconnects.
We noticed that the memory footprint of the server process increases over time. Valgrind inspection showed that despite the server threads have long been shutdown, their data allocated in TThreadedServer::serve() hasn't been freed and shows up as "definitely lost".
This leak, although significant, is not critical by itself. But per-thread data includes a TBinaryProtocol object, which in turn holds a "string buffer" used to serialize binary parameters. These string buffers are quite large in our case, leading to overall memory leakage being unacceptably high.
As a workaround, we will for now turn to TNonblockingServer, which uses persistent threads. However, a memory leak is still a very serious problem, and it should be fixed.