Potential memory leak in watch mode?
- Dominant language
- TypeScript
- Stars
- 6.4k
- Forks
- 128
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
We're starting to see regular occurrances of JS allocation failed errors:
```
<--- Last few GCs --->
[17296:000002AB37A30E60] 93614308 ms: Mark-sweep 4049.6 (4139.6) -> 4037.6 (4143.6) MB, 1787.0 / 0.0 ms (average mu = 0.390, current mu = 0.014) allocation failure; scavenge might not succeed
[17296:000002AB37A30E60] 93617298 ms: Mark-sweep 4053.6 (4143.6) -> 4041.3 (4147.1) MB, 2960.2 / 0.0 ms (average mu = 0.197, current mu = 0.010) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF6408F1ADF node_api_throw_syntax_error+203775
2: 00007FF6408714B6 SSL_get_quiet_shutdown+63558
3: 00007FF640872822 SSL_get_quiet_shutdown+68530
4: 00007FF641312F34 v8::Isolate::ReportExternalAllocationLimitReached+116
5: 00007FF6412FE2A2 v8::Isolate::Exit+674
6: 00007FF6411802FC v8::internal::EmbedderStackStateScope::ExplicitScopeForTesting+124
7: 00007FF64117D51B v8::internal::Heap::CollectGarbage+3963
8: 00007FF641193753 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath+2099
9: 00007FF641193FFD v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath+93
10: 00007FF64119C94A v8::internal::Factory::AllocateRaw+810
11: 00007FF6411AFBC9 v8::internal::FactoryBase::NewHeapNumber<0>+233
12: 00007FF6411B40D8 v8::internal::FactoryBase::NewRawOneByteString+72
13: 00007FF640F5BF67 v8::internal::String::SlowFlatten+679
14: 00007FF640E78E35 v8::internal::OptimizingCompileDispatcher::set_finalize+4021
15: 00007FF6413B05C1 v8::internal::SetupIsolateDelegate::SetupHeap+558193
16: 00007FF5E83C80AD
```
This is currently only showing up on Windows, but suspect thats just a heap size limit we haven't hit yet on OSX.
This is while running a `vite` service and a watch mode over 4 not massive but not small projects (30-50f iles per project) in a dependency chain for `tsc` compilation.
Contributor guide
Assessment
This issue has not been assessed yet.