microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

Error on tsserver startup: "JavaScript heap out of memory" #743

Closed huljar closed 4 years ago

huljar commented 4 years ago

Hi all,

recently the tsserver that is started through the plugin crashes a few minutes after starting Sublime with the following errors on node's stderr:

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 00007FF638AC879A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506
 2: 00007FF638AA3206 node::MakeCallback+4534
 3: 00007FF638AA3B80 node_module_register+2032
 4: 00007FF638DC1AFE v8::internal::FatalProcessOutOfMemory+846
 5: 00007FF638DC1A2F v8::internal::FatalProcessOutOfMemory+639
 6: 00007FF638FA8224 v8::internal::Heap::MaxHeapGrowingFactor+9620
 7: 00007FF638F9F206 v8::internal::ScavengeJob::operator=+24550
 8: 00007FF638F9D85C v8::internal::ScavengeJob::operator=+17980
 9: 00007FF638FA65A7 v8::internal::Heap::MaxHeapGrowingFactor+2327
10: 00007FF638FA6626 v8::internal::Heap::MaxHeapGrowingFactor+2454
11: 00007FF6390D08C7 v8::internal::Factory::NewFillerObject+55
12: 00007FF63914DAB6 v8::internal::operator<<+73494
13: 00000066E12DC5C1 

Is there anything I can do about that? I am working on a relatively large project and it seems like some recent commits caused the tsserver to exceed its memory limit when building. On Sublime's console, this resulted in the error message as in #696.

Thanks!

huljar commented 4 years ago

Hi everyone,

I was able to solve the problem by adding

"node_args": ["--max-old-space-size=4096"]

to my Preferences.sublime-settings to increase the maximum heap memory size.