<div dir="ltr">Hi Anil<div><br></div><div>This stack trace does not indicate DeadNonceList has a memory leak.</div><div>DeadNonceList::makeEntry invokes Name::wireEncode, which causes the Interest name to allocate new buffer. If the Interest name is retained somewhere, this memory is not released.</div><div>NDNOPS has observed a <a href="http://redmine.named-data.net/issues/3619">NameTree entry leak</a> on the testbed, which may be related to this.</div><div><div><br></div><div>Yours, Junxiao<br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 8, 2016 at 11:46 PM, Anil Jangam <span dir="ltr"><<a href="mailto:anilj.mailing@gmail.com" target="_blank">anilj.mailing@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Alex,<div><br></div><div>The reason I was trying to find an alternative because this 'wireEncode()' code path is one of the major memory consumer in ndnSIM. Although there are optimizations provided by caching the block size after first encode(), it appears that memory is not freed after first encode. </div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>==9587== 100,926,144 bytes in 73,852 blocks are still reachable in loss record 1,226 of 1,228 </div></div><div><div>==9587==    at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)</div></div><div><div>==9587==    by 0x69A08DF: allocate (new_allocator.h:104)</div></div><div><div>==9587==    by 0x69A08DF: _M_allocate (stl_vector.h:168)</div></div><div><div>==9587==    by 0x69A08DF: void std::vector<ndn::Block, std::allocator<ndn::Block> >::_M_emplace_back_aux<ndn::Block>(ndn::Block&&) (vector.tcc:404)</div></div><div><div>==9587==    by 0x699C79C: emplace_back<ndn::Block> (vector.tcc:101)</div></div><div><div>==9587==    by 0x699C79C: push_back (stl_vector.h:920)</div></div><div><div>==9587==    by 0x699C79C: ndn::Block::parse() const (block.cpp:347)</div></div><div><div>==9587==    by 0x6A1F5A8: ndn::Name::wireEncode() const (name.cpp:102)</div></div><div><div>==9587==    by 0x6B4619F: nfd::DeadNonceList::makeEntry(ndn::Name const&, unsigned int) (dead-nonce-list.cpp:108)</div></div><div><div>==9587==    by 0x6B4621D: nfd::DeadNonceList::has(ndn::Name const&, unsigned int) const (dead-nonce-list.cpp:92)</div></div><div><div>==9587==    by 0x6B25A42: nfd::Forwarder::onIncomingInterest(nfd::Face&, ndn::Interest const&) (forwarder.cpp:86)</div></div><div><div>==9587==    by 0x69B066A: operator() (functional:2471)</div></div><div><div>==9587==    by 0x69B066A: operator() (signal-signal.hpp:241)</div></div><div><div>==9587==    by 0x69B066A: operator() (signal-signal.hpp:255)</div></div><div><div>==9587==    by 0x69B066A: emit_onReceiveInterest<ndn::Interest, ndn::util::signal::DummyExtraArg> (face.hpp:194)</div></div><div><div>==9587==    by 0x69B066A: ndn::Face::Impl::asyncExpressInterest(std::shared_ptr<ndn::Interest const> const&, std::function<void (ndn::Interest const&, ndn::Data&)> const&, std::function<void (ndn::Interest const&)> const&) (face-impl.hpp:170)</div></div><div><div>==9587==    by 0x69AD13B: operator() (face.cpp:69)</div></div><div><div>==9587==    by 0x69AD13B: std::_Function_handler<void (), ndn::Face::expressInterest(ndn::Interest const&, std::function<void (ndn::Interest const&, ndn::Data&)> const&, std::function<void (ndn::Interest const&)> const&)::{lambda()#1}>::_M_invoke(std::_Any_data const&) (functional:2071)</div></div><div><div>==9587==    by 0xB84EC6C: ns3::DefaultSimulatorImpl::ProcessOneEvent() (default-simulator-impl.cc:149)</div></div></blockquote><span><font color="#888888"><div><br></div><div>/anil.</div><div><br></div></font></span></div></blockquote></div></div></div></div></div>