Bug #1803

NameTree memory leak

Added by Junxiao Shi about 7 years ago. Updated about 7 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
3.00 h


Steps to reproduce:

  1. run NFD and have traffic go through it
  2. observe nNameTreeEntries, nFibEntries, nPitEntries, nMeasurementsEntries counters over time

Expected: nNameTreeEntries is linear with (nFibEntries + nPitEntries + nMeasurementsEntries)

Actual: nNameTreeEntries is constantly growing over time

At one instance, after NFD runs for 8748 seconds, the counters are:
nNameTreeEntries=69618, nFibEntries=6, nPitEntries=16, nMeasurementsEntries=76

There are at most 98 leaf nodes on the NameTree.
In the worst case that all Names are disjoint, the average Name length would be 710 Components, which is far from the expected traffic pattern.

Therefore I conclude there is a memory leak on the usage of NameTree: when a FIB/PIT/Measurements entry is erased, the corresponding NameTree entry (if empty) isn't erased.


Updated by Junxiao Shi about 7 years ago

  • Target version set to v0.3
  • Estimated time set to 3.00 h

Code reading reveals that NameTree::eraseEntryIfEmpty is not called in FIB, Measurements, and StrategyChoice.
PIT erase procedure calls that function correctly.

Missing calls should be added.
In addition, the requirement for this function call should be noted in a Doxygen comment.


Updated by Junxiao Shi about 7 years ago

  • Status changed from New to In Progress
  • Assignee set to Junxiao Shi
  • Priority changed from Normal to High

Updated by Junxiao Shi about 7 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100

Updated by Junxiao Shi about 7 years ago

  • Status changed from Code review to Closed

Also available in: Atom PDF