首页

解决webstorm内存溢出“FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory”运行报错

标签:webstorm     发布时间:2023-07-25   

一、异常说明

打开webstorm开发工具,运行项目报“FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory...Possible EventEmitter memory leak ”js堆内存溢出错误信息,详细日志如下>>

> afs-ui@1.0.0 dev D:\project\protal-ui-1@b@> vue-cli-service serve --project afsApply@b@@b@ INFO  Starting development server...@b@10% building 2/2 modules 0 active(node:8056) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 upgrade listeners ad@b@ded. Use emitter.setMaxListeners() to increase limit@b@95% emitting CopyPlugin@b@<--- Last few GCs --->@b@@b@[8056:0000000000137D30]   277594 ms: Mark-sweep 1040.9 (1448.0) -> 1040.5 (1449.5) MB, 1160.8 / 0.0 ms  allocation failure GC in old space re@b@quested@b@[8056:0000000000137D30]   278756 ms: Mark-sweep 1040.5 (1449.5) -> 1039.1 (1398.7) MB, 1162.0 / 0.0 ms  last resort GC in old space requested@b@@b@[8056:0000000000137D30]   280033 ms: Mark-sweep 1039.1 (1398.7) -> 1039.1 (1382.2) MB, 1276.7 / 0.0 ms  last resort GC in old space requested@b@@b@@b@@b@<--- JS stacktrace --->@b@@b@==== JS stack trace =========================================@b@@b@Security context: 0000039D1BE25879 <JSObject>@b@    1: fromString(aka fromString) [buffer.js:~298] [pc=0000038DD2D7254B](this=0000018CF92022D1 <undefined>,string=00000208E62F1179 <Very long@b@ string[26482510]>,encoding=0000039D1BE35221 <String[4]: utf8>)@b@    2: from [buffer.js:177] [bytecode=000002DD530A1DE9 offset=11](this=000000A5F7DB5BB9 <JSFunction Buffer (sfi = 0000039D1BE7DC79)>,value=00@b@000208E62F1179 <Very long string[26482510]>,encodi...@b@@b@FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory@b@ 1: node_module_register@b@ 2: v8::internal::FatalProcessOutOfMemory@b@ 3: v8::internal::FatalProcessOutOfMemory@b@ 4: v8::internal::Factory::NewRawTwoByteString@b@ 5: v8::internal::Smi::SmiPrint@b@ 6: v8::internal::StackGuard::HandleInterrupts@b@ 7: v8::String::WriteUtf8@b@ 8: v8::internal::compiler::Type::Negative31@b@ 9: node::Buffer::New@b@10: node::Buffer::New@b@11: 0000038DD2B9ACE6@b@npm ERR! code ELIFECYCLE@b@npm ERR! errno 3@b@npm ERR! afs-ui@1.0.0 dev: 'vue-cli-service serve --project afsApply'@b@npm ERR! Exit status 3@b@npm ERR!@b@npm ERR! Failed at the afs-ui@1.0.0 dev script.@b@npm ERR! This is probably not a problem with npm. There is likely additional logging output above.@b@@b@npm ERR! A complete log of this run can be found in:@b@npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2023-07-24T09_13_47_385Z-debug.log

二、解决方法

1)升级安装最新npm - 控制台执行“npm install -g increase-memory-limit”命令,操作如下

PS D:\project\protal-ui-1> npm install -g increase-memory-limit@b@C:\Users\Administrator\AppData\Roaming\npm\increase-memory-limit -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\increase-memory-l@b@imit\index.js@b@+ increase-memory-limit@1.0.7@b@added 12 packages from 5 contributors in 4.863s

2)当前项目运行increase-memory-limit 命令,操作如下

PS D:\project\protal-ui-1> increase-memory-limit@b@'D:/project/protal-ui-1/node_modules/.bin/_mocha' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/_mocha.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/acorn' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/acorn.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/adler32' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/adler32.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/ansi-html' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/ansi-html.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/atob' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/atob.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/autoprefixer' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/autoprefixer.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/babel' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/babel-doctor' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/babel-doctor.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/babel-external-helpers' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/babel-external-helpers.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/babel-node' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/babel-node.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/babel.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/babylon' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/babylon.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/browserslist' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/browserslist.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/cfb' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/cfb.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/codepage' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/codepage.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/crc32' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/crc32.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/cssesc' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/cssesc.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/errno' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/errno.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/eslint' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/eslint-config-prettier-check' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/eslint-config-prettier-check.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/eslint.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/esparse' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/esparse.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/esvalidate' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/esvalidate.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/he' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/he.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/highlight' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/highlight.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/html-minifier' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/html-minifier.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/image-size' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/image-size.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/import-local-fixture' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/import-local-fixture.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/in-install' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/in-install.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/in-publish' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/in-publish.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/is-ci' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/is-ci.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/is-docker' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/is-docker.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/js-yaml' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/js-yaml.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/jsesc' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/jsesc.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/json5' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/json5.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/lessc' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/lessc.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/loose-envify' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/loose-envify.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/make-plural' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/make-plural.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/markdown-it' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/markdown-it.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/miller-rabin' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/miller-rabin.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/mime' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/mime.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/mkdirp' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/mkdirp.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/mocha' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/mocha.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/multicast-dns' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/multicast-dns.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/node-gyp' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/node-gyp.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/node-sass' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/node-sass.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/node-sass.ps1' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/nopt' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/nopt.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/not-in-install' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/not-in-install.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/not-in-publish' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/not-in-publish.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/opener' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/opener.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/parser' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/parser.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/prettier' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/prettier-eslint' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/prettier-eslint.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/prettier.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/printj' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/printj.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/regjsparser' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/regjsparser.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/resolve' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/resolve.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/rimraf' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/rimraf.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/sassgraph' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/sassgraph.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/semver' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/semver.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/sha.js' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/sha.js.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/ssf' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/ssf.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/sshpk-conv' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/sshpk-conv.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/sshpk-sign' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/sshpk-sign.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/sshpk-verify' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/sshpk-verify.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/svgo' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/svgo.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/terser' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/terser.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/tsc' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/tsc.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/tsserver' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/tsserver.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/uglifyjs' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/uglifyjs.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/user-home' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/user-home.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/uuid' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/uuid.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/vue-cli-service' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/vue-cli-service.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/webpack' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/webpack-bundle-analyzer' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/webpack-bundle-analyzer.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/webpack-dev-server' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/webpack-dev-server.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/webpack.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/which' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/which.cmd' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/xlsx' written successfully.@b@'D:/project/protal-ui-1/node_modules/.bin/xlsx.cmd' written successfully.
  • <<相关内容>>
<<热门下载>>