Skip to content

Salsa interning infra leaks memory #16176

Open

Description

I believe this to be one if not the only reason for people reporting r-a to leak memory. Some things we store in the interning stores are not very stable. Notably we store AstIds in some things which are very dependent on other constructs in the file, so they tend to shift around a lot. An example are our BlockIds, which intern AstId<Block>, these shift around basically whenever a new node is created in the tree. Now, quite often they will just overlap with a previous blocks id where things will work out just fine, but there are times where this won't be the case, causing a leak. This is made worse by the fact that BlockIds themselves are used in other interned structs, so orphaned interned blocks will create more orphans of other interned structs. These leaks are small but they will add up, so it's not surprising to me that people that have their session run for weeks will end up with a surprising memory usage.

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

Metadata

Assignees

No one assigned

    Labels

    A-perfperformance issuesBroken WindowBugs / technical debt to be addressed immediatelyC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions