-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
Fully Compatible
-
200
-
None
-
None
-
None
-
None
-
None
-
None
-
None
We should create a new class that is very much like SimpleMemoryUsageTracker, but does "chunking". That is, it only reports memory increases or decreases of memory that exceed a threshold. This avoids having to constantly update memory statistics on very hot paths.
We should only consider doing this issue if needed (such as if performance issues arise). The tradeoff here is that memory tracking would be less impactful on query performance, but also less accurate.
This new class ChunkedMemoryUsageTracker could not be a subclass of SimpleMemoryUsageTracker because we've seen that the overhead of virtual dispatch affects performance measurably. But I think that's okay. The _base pointer can still point to SimpleMemoryUsageTracker and everything should work fine, and we wouldn't need to use any virtual methods.
For an example of chunked memory tracking, one can look at the streams code here.
- related to
-
SERVER-108667 PlanStage Sort memory tracking caused performance regression
-
- Closed
-