Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ public NodeStatsTracker createTaskStatsTrackers(TaskId taskId)

// when nodeStatsTracker is garbage collected, run the cleanup method on the tracker
// Note: tracker can not have a reference to nodeStatsTracker
finalizerService.addFinalizer(nodeStatsTracker, splitTracker::cleanup);
finalizerService.addFinalizer(memoryUsageTracker, memoryUsageTracker::cleanup);
finalizerService.addFinalizer(cpuUtilizationPercentageTracker, cpuUtilizationPercentageTracker::cleanup);
// instances of TaskStatsTracker and AccumulatedTaskStatsTracker should not be passed for GC to
// help ensure that GC is actually invoked for nodeStatsTracker
finalizerService.addFinalizer(nodeStatsTracker, () -> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps, add a comment explaining that this cannot be broken down into 3 separate finalizers as this is non-obvious

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the necessary comment

splitTracker.cleanup();
memoryUsageTracker.cleanup();
cpuUtilizationPercentageTracker.cleanup();
});

return nodeStatsTracker;
}
Expand Down