NameTree memory leak
Steps to reproduce:
- run NFD and have traffic go through it
- 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.
#1 Updated by Junxiao Shi about 5 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.