[LayaAirIDE 2.0]JavaScript heap out of memory,ide编译不了代码
编译时输出控制台出现以下报错,编译不了代码
出错了:FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
<--- Last few GCs --->
[8912:005A00C8] 319470 ms: Mark-sweep 982.8 (1183.0) -> 971.7 (1172.4) MB, 632.9 / 0.0 ms allocation failure GC in old space requested
[8912:005A00C8] 320150 ms: Mark-sweep 971.7 (1172.4) -> 971.6 (1173.9) MB, 680.1 / 0.0 ms allocation failure GC in old space requested
[8912:005A00C8] 320845 ms: Mark-sweep 971.6 (1173.9) -> 971.5 (1139.9) MB, 694.8 / 0.0 ms last resort
[8912:005A00C8] 321530 ms: Mark-sweep 971.5 (1139.9) -> 971.5 (1126.4) MB, 685.8 / 0.0 ms last resort
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0BA18CC5 <JS Object>
1: fromString(aka fromString) [buffer.js:~194] [pc=7BB54E79](this=216041A1 <undefined>,string=7AE742AD <Very long string[28528381]>,encoding=216041A1 <undefined>)
2: new constructor(aka Buffer) [buffer.js:~75] [pc=7B6A4B9C](this=7AE742C1 <a Buffer with map 3D42E605>,arg=7AE742AD <Very long string[28528381]>,encodingOrOffset=216041A1 <undefined>,length=216041A1 <undefined>)
3: arguments ad...
出错了:FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
<--- Last few GCs --->
[8912:005A00C8] 319470 ms: Mark-sweep 982.8 (1183.0) -> 971.7 (1172.4) MB, 632.9 / 0.0 ms allocation failure GC in old space requested
[8912:005A00C8] 320150 ms: Mark-sweep 971.7 (1172.4) -> 971.6 (1173.9) MB, 680.1 / 0.0 ms allocation failure GC in old space requested
[8912:005A00C8] 320845 ms: Mark-sweep 971.6 (1173.9) -> 971.5 (1139.9) MB, 694.8 / 0.0 ms last resort
[8912:005A00C8] 321530 ms: Mark-sweep 971.5 (1139.9) -> 971.5 (1126.4) MB, 685.8 / 0.0 ms last resort
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0BA18CC5 <JS Object>
1: fromString(aka fromString) [buffer.js:~194] [pc=7BB54E79](this=216041A1 <undefined>,string=7AE742AD <Very long string[28528381]>,encoding=216041A1 <undefined>)
2: new constructor(aka Buffer) [buffer.js:~75] [pc=7B6A4B9C](this=7AE742C1 <a Buffer with map 3D42E605>,arg=7AE742AD <Very long string[28528381]>,encodingOrOffset=216041A1 <undefined>,length=216041A1 <undefined>)
3: arguments ad...
没有找到相关结果
已邀请:
要回复问题请先登录
3 个回复
君昊
赞同来自: Yan
然后cmd 输入下面命令node --max_old_space_size=2048 ide的rollup.js完整目录地址。
就可以解决编译内存溢出的问题。不过,最好先确保自己的项目代码没有出现死循环或其他引起的内存溢出在考虑这个。要不,就算增加了。项目代码有问题的话。埋下的问题就难找了
如果上述处理有问题。可以尝试一下下面链接对应的做法:https://ask.layabox.com/question/49299
Aar0n
赞同来自:
1567600631用户
赞同来自: