Ionic-分配失败-JavaScript堆内存不足

时间:2018-10-05 19:22:37

标签: ionic-framework ionic2 ionic3 ionic-native

我遇到一些错误,我尝试构建我的Ionic应用程序,我尝试了很多事情,但是没有用..那就是我尝试过的事情:

 "scripts": {
"clean": "ionic-app-scripts clean",
"build": "node --max-old-space-size=2048 ./node_modules/.bin/ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
 },

sudo节点--max-old-space-size = 4096 / usr / local / bin / ionic cordova构建android --prod sudo节点--max-old-space-size = 8196 / usr / local / bin / ionic cordova构建android --prod

---------------------------------错误:

<--- Last few GCs --->

[6482:0x3d981d0]   295201 ms: Mark-sweep 4034.2 (4143.6) -> 4034.2  (4143.6) MB, 3372.5 / 0.0 ms  allocation failure GC in old space requested
[6482:0x3d981d0]   299051 ms: Mark-sweep 4034.2 (4143.6) -> 4034.2 (4127.6) MB, 3848.7 / 0.0 ms  last resort GC in old space requested
[6482:0x3d981d0]   302348 ms: Mark-sweep 4034.2 (4127.6) -> 4034.2 (4127.6) MB, 3296.8 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

0: ExitFrame [pc: 0x3a46b1e0427d]
Security context: 0x30ba8a6206a9 <JSObject>
1: setEmitFlags [/home/kill/Documents/iapp/ioo/ionic/node_modules /@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:~49349] [pc=0x3a46b2e932ba](this=0x368505ba3269 <Object map  = 0xbfaea5b5881>,node=0x1a071e0bf419 <IdentifierObject map = 0x1b4dd8085311>,emitFlags=16777216)
2: createEntityNameFromSymbolChain(aka createEntityName...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [ionic]
2: 0x87b56c [ionic]
3: v8::Utils::ReportOOMFailure(char const*, bool) [ionic]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [ionic]
5: v8::internal::Factory::NewByteArray(int, v8::internal::PretenureFlag)    [ionic]
6:  v8::internal::SourcePositionTableBuilder::ToSourcePositionTable(v8::internal::Isolate*) [ionic]
7: v8::internal::compiler::CodeGenerator::FinalizeCode() [ionic]
8: v8::internal::compiler::PipelineImpl::FinalizeCode() [ionic]
9: v8::internal::compiler::PipelineCompilationJob::FinalizeJobImpl(v8::internal::Isolate*) [ionic]
10: v8::internal::Compiler::FinalizeCompilationJob(v8::internal::CompilationJob*, v8::internal::Isolate*) [ionic]
11: v8::internal::OptimizingCompileDispatcher::InstallOptimizedFunctions() [ionic]
12: v8::internal::StackGuard::HandleInterrupts() [ionic]
13: v8::internal::Runtime_StackGuard(int, v8::internal::Object**, v8::internal::Isolate*) [ionic]
14: 0x3a46b1e0427d
Aborted

0 个答案:

没有答案