Skip to content

Addressed memory leaks and improved overall memory usage - #1799

Merged
pelaezryan merged 2 commits into
awslabs:masterfrom
pelaezryan:master
Jul 28, 2026
Merged

pelaezryan merged 2 commits into
awslabs:masterfrom
pelaezryan:master

Conversation

@pelaezryan

Copy link
Copy Markdown
Contributor
  1. Fixed a memory leak in PeriodicShardSyncManager where hashRangeHoleTrackerMap retained entries for deleted streams by adding cleanup via retainAll after each sync run.
  2. Reduced memory overhead in LeaseAssignmentManager by replacing full Lease object storage in prevRunLeasesState with a lightweight LeaseCounterSnapshot that only retains the fields actually needed
  3. streamToShardSyncTaskManagerMap in the Scheduler is a class level map that is always added to but never cleaned up. The only time this map was getting "flushed" was during a deployment where the leader is bounced. This change introduces cleanup logic to that map.

@pelaezryan pelaezryan changed the title Addressed memory related issues and leaks Addressed memory leaks and improved overall memory usage Jul 28, 2026
@pelaezryan
pelaezryan deployed to manual-approval July 28, 2026 17:41 — with GitHub Actions Active
scope.end();
}
} else {
log.debug("WorkerId {} is not a leader, not running the shard sync task", workerId);

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.

Actually as a good practice we should clean up any state on leader when the leader changes

@pelaezryan
pelaezryan merged commit f19bc3b into awslabs:master Jul 28, 2026
6 of 7 checks passed

This branch was successfully deployed

1 active deployment
manual-approval β€” ee80f261 Deployed Jul 28, 2026 by pelaezryan via wait-for-approval #295
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants