Skip to content

Conversation

@VillePihlava
Copy link
Contributor

Summary

For some reason patternsForStop is not cleared in the clear method of TimetableSnapshot. This seems to cause a memory leak. This PR adds a clear function to do this. We are currently testing this to see if it fixes our release-blocking performance problems. Even if it doesn't fix them, I think this should still be merged.

Issue

N/A

Unit tests

N/A

Documentation

Added javadoc and improved existing ones

@VillePihlava VillePihlava requested a review from a team as a code owner January 30, 2026 09:08
@VillePihlava VillePihlava added !Bug Apply to issues describing a bug and PRs witch fixes it. !Optimization The feature is to improve performance. HSL Helsinki Regional Transport Authority Digitransit Test Feature is under testing in Digitransit environment(s) labels Jan 30, 2026
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.14%. Comparing base (fb577ad) to head (8a329df).
⚠️ Report is 16 commits behind head on dev-2.x.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #7253      +/-   ##
=============================================
+ Coverage      72.12%   72.14%   +0.02%     
- Complexity     21085    21089       +4     
=============================================
  Files           2297     2297              
  Lines          85223    85235      +12     
  Branches        8487     8489       +2     
=============================================
+ Hits           61465    61492      +27     
+ Misses         20781    20767      -14     
+ Partials        2977     2976       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@optionsome
Copy link
Member

@tkalvas should realTimeAddedReplacedByTripOnServiceDateById be cleared as well?

@tkalvas
Copy link
Contributor

tkalvas commented Jan 30, 2026

@tkalvas should realTimeAddedReplacedByTripOnServiceDateById be cleared as well?

Yes, definitely. Although this only comes into play if updateIncrementality == FULL_DATASET, but then it is a clear mistake that I didn't include it.

@optionsome
Copy link
Member

I think TimetableSnapshot#isEmpty should probably check that all of these collections are empty and we could improve tests for it so that the snapshot is empty after it's cleared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it. Digitransit Test Feature is under testing in Digitransit environment(s) HSL Helsinki Regional Transport Authority !Optimization The feature is to improve performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants