Remove unused field, fix LruCache. #4110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For #4025.
The field
_loadingIdsis unused, remove it. This was wasting some RAM but not actually a leak as the enclosing class gets discarded/recreated every build.LruCachemaintains both a map ID->Entry and a linked list of entries. On remove, it was removing from the map but not from the list. This would cause the data to be retained longer than necessary, but only up to the max size of the cache, so it's not a full leak. It's anyway not measurable in the leak test because files are stored in RAM for testing so they are retained whether or not they are in the cache.Update the max leak size in the leak test, as the latest analyzer version fixed the leak to do with analyzer integration.
I ran several thousand builds in watch mode with this version and don't see anything else that needs fixing; the resident size ended up larger than I'd like (~4.5GB) but the retained size was still small, under 1GB. Maybe that's something we can still improve but if so I guess it should be after moving to AOT compilation.