microsoft / microsoft/TypeScript

Heap out of memory on version 4.2

Abierto
#42,989 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Needs Investigation
Lenguaje dominante
Go
Estrellas
111k
Forks
14.3k
Merge medio
1 d 19 h
PR fusionados (30 d)
117

Descripción

Bug Report

🔎 Search Terms
  • memory
🕗 Version & Regression Information

On a Vue project the compiler crashes with Heap out of memory. This does not happen on version 4.1.3.

⠙  Building for production...Starting type checking service...
Using 1 worker with 2048MB memory limit
⠼  Building for production...
<--- Last few GCs --->

[34642:0x41419c0]   211431 ms: Scavenge 956.0 (980.7) -> 940.2 (980.7) MB, 0.3 / 0.0 ms  (average mu = 0.996, current mu = 0.994) allocation failure 
[34642:0x41419c0]   211566 ms: Scavenge 956.0 (980.7) -> 940.2 (980.7) MB, 0.3 / 0.0 ms  (average mu = 0.996, current mu = 0.994) allocation failure 
[34642:0x41419c0]   211705 ms: Scavenge 956.0 (980.7) -> 940.2 (980.7) MB, 0.3 / 0.0 ms  (average mu = 0.996, current mu = 0.994) allocation failure 


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0xa9c298dbf1d]
Security context: 0x29d2e9a1e6c1 <JSObject>
    1: parseList(aka parseList) [0x292d524ccc59] [/home/qp/IdeaProjects/MyEtherWallet/node_modules/typescript/lib/typescript.js:~30031] [pc=0xa9c29c58125](this=0x3ba7b93026f1 <undefined>,kind=0,parseElement=0x292d524cfa99 <JSFunction parseStatement (sfi = 0x3ef7041e4489)>)
    2: parseSourceFileWorker(aka parseSourceFileWorker) [0x292d524cbb99] [/home/qp/Idea...

FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory
 1: 0x8fb090 node::Abort() [/home/qp/.nvm/versions/node/v10.23.3/bin/node]
 2: 0x8fb0dc  [/home/qp/.nvm/versions/node/v10.23.3/bin/node]
 3: 0xb033be v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/home/qp/.nvm/versions/node/v10.23.3/bin/node]
 4: 0xb035f4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/home/qp/.nvm/versions/node/v10.23.3/bin/node]
 5: 0xef7652  [/home/qp/.nvm/versions/node/v10.23.3/bin/node]
 6: 0xed0734 v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::Heap::RootListIndex, int, v8::internal::Object*, v8::internal::PretenureFlag) [/home/qp/.nvm/versions/node/v10.23.3/bin/node]
 7: 0xed0d07 v8::internal::Factory::NewUninitializedFixedArray(int, v8::internal::PretenureFlag) [/home/qp/.nvm/versions/node/v10.23.3/bin/node]
 8: 0xe8408f  [/home/qp/.nvm/versions/node/v10.23.3/bin/node]
 9: 0x112a71d v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [/home/qp/.nvm/versions/node/v10.23.3/bin/node]
10: 0xa9c298dbf1d 
⠼  Building for production...Type checking and linting aborted - probably out of memory. Check `memoryLimit` option in ForkTsCheckerWebpackPlugin configuration.
⠏  Building for production...
⏯ How to reproduce:
  1. Use Node 10
  2. git clone --branch 21-add-typescript-support git@github.com:theqp/MyEtherWallet.git
  3. Change typescript to 4.2.2 (it would work otherwise)
  4. npm i
  5. echo "" > package-test.js && NODE_OPTIONS="--max-old-space-size=4096" npm run build
  6. Wait for the crash :D

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza reproduciendo la compilación de Node 10 usando la rama de MyEtherWallet indicada, TypeScript 4.2.2 y el comando npm run build. Inspecciona las entradas de pila parseList y parseSourceFileWorker en node_modules/typescript/lib/typescript.js, junto con la configuración memoryLimit de ForkTsCheckerWebpackPlugin. Se considera terminado cuando la compilación 4.2.2 se completa sin agotar el heap de JavaScript y la regresión sigue cubierta.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
node.js, typescript
Área
compilers, performance
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.