I ran "cdktf get" which downloads azurerm and builds a "generated" directory with the modules in it
What did you expect to see?
gopls in a vscode environment coping with the cdktf generated libraries.
Limited required memory and cpu consumption from gopls
What did you see instead?
Raising an issue to see if there is optimisation potential
There are an awful lot of stubs in the azurerm provider generated code and it appears to provoke >6GB memory usage from gopls which caused OOM errors. Workaround was to reconfigure WSL2 to 8GB.
if you combine the gopls memory consumption with the vscode and cdktf memory consumption ..... it is not possible to run vscode/gopls and issue cdktf build commands at the same time.
Thank you for this issue, and apologies for the slow response (for some reason this issue wasn't put into the Unreleased milestone until I updated the issue title, so it avoided our triage process...).
Generally speaking, gopls uses a lot of memory. This is something we're working on fixing, but it will be a long road.
However, in this case there may be specific problems related to the cdk that we can mitigate.