I am also trying to learn the TS APIs. I think you are supposed to call the TS...Release if you get a reference. E.g. if (TS_SUCCESS == TSHttpTxnClientReqGet(txnp, &buffer, &hdr_loc)) { TSDebug(PLUGIN_NAME, "Found client request"); txn_info += R"(,"client-request":)" + collect_headers(buffer, hdr_loc, TSHttpTxnClientReqBodyBytesGet(txnp)); TSHandleMLocRelease(buffer, TS_NULL_MLOC, hdr_loc); buffer = nullptr; }
On Mon, Mar 4, 2019 at 6:06 PM Dk Jack <dnj0...@gmail.com> wrote: > Thanks Pushkar, I'll try that... > > On Mon, Mar 4, 2019 at 4:44 PM Pushkar Pradhan > <pprad...@verizonmedia.com.invalid> wrote: > > > Perhaps compiling with LSAN will help: --enable-lsan enable > > stand-alone Leak Sanitizer > > > > > > On Mon, Mar 4, 2019 at 4:42 PM Bryan Call <bc...@apache.org> wrote: > > > > > Looking at the graphs it looks like your headers and http1client > sessions > > > are leaking. Have you looked at this example to on how to send back > > error > > > messages using the C++ API: > > > > > > https://github.com/apache/trafficserver/blob/master/example/cppapi/customresponse/CustomResponse.cc > > > > > > -Bryan > > > > > > > On Mar 4, 2019, at 3:50 PM, Dk Jack <dnj0...@gmail.com> wrote: > > > > > > > > Hi, > > > > I am trying to chase a memory leak issue. I am using ATS version > 6.2.3 > > > and > > > > I have a custom plugin written using the c++ API (atscppapi) running > on > > > the > > > > same server. I enabled memory dump in my configuration and sent > traffic > > > > into the ATS with and without my plugin for an hour. Later, I > extracted > > > the > > > > individual memory stats and plotted the stats for each object type > > > against > > > > time. The link shown below contains side-by-side plots for each ATS > > > object > > > > type without and with my plugin (the right side figures are with my > > > plugin > > > > enabled). > > > > > > > > > https://www.dropbox.com/s/rfszd6fnjydm8s7/ats_mem_stats_comparison.pdf > > > > > > > > Without my plugin, the memory consumption increases for various > objects > > > in > > > > the beginning and then tapers off. However, with my plugin enabled, > the > > > > memory consumption is higher and more erratic. I am not holding on to > > the > > > > request in my plugin. My plugin attaches TransactionPlugin to some > > > > transactions (sending back 4xx response to client). For most others, > it > > > > lets it pass through. My plugin, doesn't allocate much memory. The > > memory > > > > it allocates is sort of semi-static (manages a few maps that are > > updated > > > > periodically). I don't anticipate my plugin's memory consumption to > > > > increase with the transactions. > > > > > > > > Since the presence of my plugin is the affecting the memory stats of > > > > internal ATS objects, I am suspecting this could result of me not > using > > > the > > > > API correctly. Would appreciate if anyone can venture a guess as to > > what > > > > could be happening. Thank for help. > > > > > > > > Dk. > > > > > > > > >