[Bug]: Unnecessarily created closure environments take up lots of memory while compiling Ballerina projects #41448
Labels
needTriage
The issue has to be inspected and labeled manually
Priority/Blocker
Reason/EngineeringMistake
The issue occurred due to a mistake made in the past.
Team/CompilerFE
All issues related to Language implementation and Compiler, this exclude run times.
Type/Bug
userCategory/Compilation
Milestone
Description
This is related to issue #41407. When we define an annotation, we represent the annotation with a lambda function in desugaring phase. The variables can be referred inside the annotation and they can therefore be closures. If we have lots of annotations we clone the closure environments in multiple places and they are not getting cleaned up properly. This can cause Out-of-memory issues when compiling larger projects.
Steps to Reproduce
Affected Version(s)
2201.7.x
OS, DB, other environment details and versions
No response
Related area
-> Compilation
Related issue(s) (optional)
#41407
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: