You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Artem Koval (JIRA)" <ji...@apache.org> on 2014/08/29 13:03:52 UTC
[jira] [Created] (THRIFT-2682) TThreadedServer leaks per-thread
memory
Artem Koval created THRIFT-2682:
-----------------------------------
Summary: TThreadedServer leaks per-thread memory
Key: THRIFT-2682
URL: https://issues.apache.org/jira/browse/THRIFT-2682
Project: Thrift
Issue Type: Bug
Components: C++ - Library
Affects Versions: 0.9.1
Environment: RHEL 6.5
Reporter: Artem Koval
Priority: Critical
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.
--
This message was sent by Atlassian JIRA
(v6.2#6252)