Open mkustermann opened 2 years ago
Yes, we set these scopeLookupResult
values while resolving AST, and could clear them after linking the element model (or resolving a unit, although now I wonder if it could be used in lints instead of LinterContext.resolveNameInScope()
). But 1MB does not look huge to me, so may be it is not worth efforts.
When running the analyzer on flutter and it's transitive dependencies twice, once with an empty memory store and the second time with cleared library context but populated memory store we observe
PrefixScopeLookupResult
objects alive (~ 1 MB)An example retaining path for those
PrefixScopeLookupResult
objects is:It appears the
SimpleIdentifierImpl.scopeLookupResult
is set during resolution (see resolver.dart):The fact that we don't have those objects when running with cached files in the memory store indicates that maybe the
scopeLookupResult
needs to be cleared at some point???/cc @scheglov @bwilkerson