Fatal error happens when compiling react. FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed.
還沒有人認領這個 Issue。
- 主要語言
- JavaScript
- 星號
- 11.8k
- 分支
- 7.9k
- 平均合併
- 1 天 11 小時
- 30 天內合併 PR
- 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 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 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