Loading large files causes JavaScript heap out of memory #1481
Replies: 1 comment 7 replies
-
Hey @we-wake-act21, It's pretty interesting that you hit the heap limit that early. Are you running on a memory restricted machine? We have a few projects where large workspaces (1 mil+ LoC) are common and we get to roughly 3GB of used memory on those. A repro example to see what's exactly the issue would be appreciated.
You can override the Aside from that, it probably makes sense for you to perform a bit of profiling on the language server process. Just to see which parts of Langium/your language are taking such a large amount of memory. |
Beta Was this translation helpful? Give feedback.
-
current my DSL is using two separate Langium based DSL (
expression.langium
&model.langium
) to build ASTNode.Model.langium
refers toexpression.langium
asStatement: models+=model*;
model infers Statement: exp=OxElement '=>' children+=Statement ;
where as the
expression.langium
consists of language based on ox-language.when i am trying to load multiple large files (in my scenario 20) with more than 10000 LOC. The application crashes with error as
JavaScript heap out of memory
.after making the following changes i was able to load the langium documents
model infers Statement: exp=STRING '=>'children+=Statement ;
So, in my analysis the object size with multiple statements and expression the ASTNode is becoming quite complex but after removing the dependency of
Expression.langium
the problem does not persists with same LOC and files.So is there any way to approach this problem? or is there any way to load specific number of files at a time ?
currently, I am using langium as a DSL for Theia and GLSP based Application,
Versions:
Beta Was this translation helpful? Give feedback.
All reactions