Fatal error happens when compiling react. FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed.
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 11.8k
- フォーク
- 7.9k
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 11
説明
When I try to compile my some not small react project, this error happens.
But, it is not always, and sometimes happens, sometimes not happens,
But along time goes, it happens more often.
There, node_modules\webpack\lib\Stats.js can be other js file, ex. formatLocation.js
Whenever this error happens, yarn service is terminated, and i should do 'yarn start' again.
Could you help me to fix this error?
Compiling...
<--- Last few GCs --->
[16224:000002AF7B7C2B00] 324452 ms: Mark-sweep 1320.5 (1444.2) -> 1306.6 (1442.7) MB, 440.9 / 0.0 ms (average mu = 0.219, current mu = 0.127) allocation failure scavenge might not succeed
[16224:000002AF7B7C2B00] 324998 ms: Mark-sweep 1324.4 (1442.7) -> 1315.9 (1441.2) MB, 465.5 / 0.1 ms (average mu = 0.183, current mu = 0.146) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 00000000B315C5C1]
1: StubFrame [pc: 00000000B315DB86]
Security context: 0x03fce051e6e9
2: /* anonymous /(aka / anonymous */) [0000000D1F8A6029] [MY_REACT_PROJECT_PATH\node_modules\webpack\lib\Stats.js:~540] [pc=00000000B4EF33D1](this=0x00e61e9826f1 ,reason=0x02c010a6c041 )
3: arguments adaptor frame: 3->1
4: map [000003FCE0506E61](this=0x022e...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF72344C6AA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506
2: 00007FF723427416 node::MakeCallback+4534
3: 00007FF723427D90 node_module_register+2032
4: 00007FF72374189E v8::internal::FatalProcessOutOfMemory+846
5: 00007FF7237417CF v8::internal::FatalProcessOutOfMemory+639
6: 00007FF723927F94 v8::internal::Heap::MaxHeapGrowingFactor+9620
7: 00007FF72391EF76 v8::internal::ScavengeJob::operator=+24550
8: 00007FF72391D5CC v8::internal::ScavengeJob::operator=+17980
9: 00007FF723926317 v8::internal::Heap::MaxHeapGrowingFactor+2327
10: 00007FF723926396 v8::internal::Heap::MaxHeapGrowingFactor+2454
11: 00007FF723A50637 v8::internal::Factory::NewFillerObject+55
12: 00007FF723ACD826 v8::internal::operator<<+73494
13: 00000000B315C5C1
error Command failed with exit code 134.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず報告されたコンパイル失敗を再現し、node_modules\webpack\lib\Stats.js の 540 行目付近にあるスタックトレースの位置を調べます。コンパイルフローを yarn start コマンドおよび提供された heap-error の出力と比較します。React プロジェクトが yarn サービスを終了させずにコンパイルできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, nodejs, react, webpack
- 領域
- build-system, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 20/100