{"id":138328,"date":"2020-07-21T10:52:27","date_gmt":"2020-07-21T02:52:27","guid":{"rendered":"http:\/\/4563.org\/?p=138328"},"modified":"2020-07-21T10:52:27","modified_gmt":"2020-07-21T02:52:27","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88%e6%88%91%e7%9a%84-jest-%e4%b8%80%e8%b7%91%e5%b0%b1%e4%bc%9a%e6%8c%82%e6%8e%89%ef%bc%8c%e9%94%99%e8%af%af%e6%8f%90%e7%a4%ba%e4%b8%80%e4%bc%9a%e5%84%bf%e6%98%af-out-of-memory","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=138328","title":{"rendered":"\u4e3a\u4ec0\u4e48\u6211\u7684 Jest \u4e00\u8dd1\u5c31\u4f1a\u6302\u6389\uff0c\u9519\u8bef\u63d0\u793a\u4e00\u4f1a\u513f\u662f out of memory\uff0c\u4e00\u4f1a\u513f\u662f EPIPE"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e3a\u4ec0\u4e48\u6211\u7684 Jest \u4e00\u8dd1\u5c31\u4f1a\u6302\u6389\uff0c\u9519\u8bef\u63d0\u793a\u4e00\u4f1a\u513f\u662f out of memory\uff0c\u4e00\u4f1a\u513f\u662f EPIPE               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yazoox <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>windows 10 (1709)<\/p>\n<p>node 10.19.0<\/p>\n<p>Jest 26.0.1<\/p>\n<p>\u673a\u5668\u6709 32g \u5185\u5b58\u3002\u7f16\u8bd1\u548c\u8fd0\u884c\u90fd\u6ca1\u6709\u95ee\u9898\uff0c\u5c31\u662f jest \u65e0\u6cd5\u6b63\u5e38\u8dd1\u5b8c\u3002<\/p>\n<p>\u8fd9\u4e2a\u662f\u548b\u56de\u4e8b\u513f\uff0c\u6ca1\u6709\u5934\u7eea\u5462\u3002<\/p>\n<p>\u5728 macos \u4e0b\u8dd1 jest \u5c31\u6ca1\u6709\u95ee\u9898<\/p>\n<pre><code>&lt;--- Last few GCs ---&gt;  [39960:0000015619EDC4D0]   127030 ms: Scavenge 25.7 (30.5) -&gt; 24.9 (30.5) MB, 0.8 \/ 0.0 ms  (average mu = 0.998, current mu = 0.999) allocation failure [39960:0000015619EDC4D0]   129628 ms: Scavenge 25.8 (30.5) -&gt; 24.9 (30.5) MB, 1.2 \/ 0.0 ms  (average mu = 0.998, current mu = 0.999) allocation failure [39960:0000015619EDC4D0]   131365 ms: Scavenge 25.8 (30.5) -&gt; 24.9 (30.5) MB, 0.8 \/ 0.0 ms  (average mu = 0.998, current mu = 0.999) allocation failure   &lt;--- JS stacktrace ---&gt;  ==== JS stack trace =========================================      0: ExitFrame [pc: 00000230F2BDC87C]     1: StubFrame [pc: 00000230F2C0FAB5] Security context: 0x00c35e29e6e9 &lt;JSObject&gt;     2: initialize [0000011BDB729891] [C:srcweb-2ndnode_modulesjest-workerbuildworkersChildProcessWorker.js:145] [bytecode=000001792A6C2509 offset=111](this=0x034bdb811831 &lt;ChildProcessWorker map = 0000005E90AC1AD1&gt;)     3: _onExit [0000011BDB729901] [C:srcweb-2ndnode_modulesjest-workerbuildworkersChildP...  FATAL ERROR: Committing semi space failed. Allocation failed - JavaScript heap out of memory  1: 00007FF7C169832A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506  2: 00007FF7C1672DB6 node::MakeCallback+4534  3: 00007FF7C1673730 node_module_register+2032  4: 00007FF7C198C14E v8::internal::FatalProcessOutOfMemory+846  5: 00007FF7C198C07F v8::internal::FatalProcessOutOfMemory+639  6: 00007FF7C1B72874 v8::internal::Heap::MaxHeapGrowingFactor+9620  7: 00007FF7C1B6986C v8::internal::ScavengeJob::operator=+24572  8: 00007FF7C1B67EAC v8::internal::ScavengeJob::operator=+17980  9: 00007FF7C1B70BF7 v8::internal::Heap::MaxHeapGrowingFactor+2327 10: 00007FF7C1B70C76 v8::internal::Heap::MaxHeapGrowingFactor+2454 11: 00007FF7C1C9AB9B v8::internal::Factory::AllocateRawWithImmortalMap+59 12: 00007FF7C1C9D50D v8::internal::Factory::NewRawOneByteString+77 13: 00007FF7C1C9CC5A v8::internal::Factory::NewStringFromTwoByte+154 14: 00007FF7C19A7ED1 v8::String::NewFromTwoByte+385 15: 00007FF7C15F3453 v8::internal::StackGuard::ArchiveSpacePerThread+24899 16: 00007FF7C1D7FF98 v8::internal::InterpreterDispatchDescriptor::InitializePlatformIndependent+584 17: 00007FF7C1D81953 v8::internal::InterpreterDispatchDescriptor::InitializePlatformIndependent+7171 18: 00007FF7C1D821DA v8::internal::InterpreterDispatchDescriptor::InitializePlatformIndependent+9354 19: 00007FF7C1D82471 v8::internal::InterpreterDispatchDescriptor::InitializePlatformIndependent+10017 20: 00007FF7C1D806B0 v8::internal::InterpreterDispatchDescriptor::InitializePlatformIndependent+2400 21: 00007FF7C1D81135 v8::internal::InterpreterDispatchDescriptor::InitializePlatformIndependent+5093 22: 00007FF7C19E74E3 v8::internal::Object::ToInt32+12803 23: 00007FF7C1C94CE3 v8::internal::wasm::WasmCodeManager::LookupCode+51395 24: 00000230F2BDC87C error Command failed with exit code 134. info Visit https:\/\/yarnpkg.com\/en\/docs\/cli\/run for documentation about this command. <\/code><\/pre>\n<p>\u6216\u8005<\/p>\n<pre><code>      throw er; \/\/ Unhandled 'error' event       ^  Error: write EPIPE     at ChildProcess.target._send (internal\/child_process.js:762:20)     at ChildProcess.target.send (internal\/child_process.js:634:19)     at ChildProcessWorker.send (C:srcweb-2ndnode_modulesjest-workerbuildworkersChildProcessWorker.js:291:17)     at WorkerPool.send (C:srcweb-2ndnode_modulesjest-workerbuildWorkerPool.js:32:34)     at Farm._process (C:srcweb-2ndnode_modulesjest-workerbuildFarm.js:129:10)     at Farm._enqueue (C:srcweb-2ndnode_modulesjest-workerbuildFarm.js:152:10)     at Farm._push (C:srcweb-2ndnode_modulesjest-workerbuildFarm.js:159:12)     at Promise (C:srcweb-2ndnode_modulesjest-workerbuildFarm.js:90:14)     at new Promise (&lt;anonymous&gt;)     at Farm.doWork (C:srcweb-2ndnode_modulesjest-workerbuildFarm.js:56:12) Emitted 'error' event at:     at process.nextTick (internal\/child_process.js:766:39)     at process._tickCallback (internal\/process\/next_tick.js:61:11) error Command failed with exit code 1. info Visit https:\/\/yarnpkg.com\/en\/docs\/cli\/run for documentation about this command. <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2573150\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : WittBulter <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u4e00\u4e0b jest -w 1                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2573151\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : msg7086 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Let me Google that for you?<\/p>\n<p>https:\/\/stackoverflow.com\/q\/38558989\/2221631 \u770b\u770b\u80fd\u4e0d\u80fd\u89e3\u51b3\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2573152\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : seki <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6362\u4e2a node \u5927\u7248\u672c<br \/>\u770b\u770b Jest \u5468\u8fb9\u7684\u4e00\u4e9b\u5e93\u662f\u4e0d\u662f\u6ca1\u6709\u5347\u5230\u65b0\u7248\u672c<br \/>\u6539\u53d8\u4e00\u4e0b\u6d4b\u8bd5\u7684\u6570\u91cf\uff0c\u4ece 1 \u4e2a\u5f00\u59cb<br \/>\u6539\u53d8\u4e00\u4e0b\u5e76\u884c worker \u7684\u6570\u91cf<br \/>\u5728 wsl \u5e95\u4e0b\u8dd1<\/p>\n<p>\u90fd\u8bd5\u8bd5\u770b                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2573153\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jiangzhuo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u90fd 32G \u4e86\u5c31\u7ed9\u8fdb\u7a0b\u591a\u5206\u70b9\u5185\u5b58\u5457\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2573154\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yazoox <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @jiangzhuo #4 \u8fd9\u4e2a\u2026\u2026 \u600e\u4e48\u6307\u5b9a \/\u5206\u914d\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2573155\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yazoox <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @seki #3 \u53ea\u8dd1\u4e00\u4e2a test\uff0c\u6216\u8005\u4e00\u4e2a suite \u90fd\u6ca1\u95ee\u9898\u3002<br \/>\u77e5\u9053\u7edf\u4e00\u8dd1\uff0c\u5c31\u4e0d\u884c\u4e86\u3002<\/p>\n<p>\u53e6\uff0c\u600e\u4e48\u8bbe\u5b9a worker \u7b49\u53c2\u6570\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2573156\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jiangzhuo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @yazoox #5 node &#8211;v8-options \u91cc\u6709\u5199                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u6211\u7684 Jest \u4e00\u8dd1\u5c31\u4f1a\u6302\u6389&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/138328"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=138328"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/138328\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=138328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=138328"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=138328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}