解决webstrom卡顿问题(禁止加载node_modules目录和解决内存溢出)

本文介绍如何在WebStorm中禁用node_modules目录的加载,以及调整虚拟机参数避免内存溢出问题,通过设置-Xms和-Xmx参数来提高WebStorm的运行效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

- 禁止webstrom加载node_modules目录

在这里插入图片描述
file-settings-editor-file types 最下面一行里面写上node_modules。

- 解决webstorm内存溢出

找到webstrom安装目录bin文件夹下的webstorm64.exe.vmoptions和webstorm.exe.vmoptions文件
修改以下两个参数
结果如下:

-Xms526m 
-Xmx1024m 

(这里-Xms最大值不能超过1024,否则webstorm将无法打开)

> wms_version1@0.1.0 serve D:\code\code\wms0217\wms_version1 > vue-cli-service serve INFO Starting development server... <--- Last few GCs ---> [23756:000002AE3BCBBC60] 38412 ms: Mark-sweep (reduce) 2044.2 (2051.5) -> 2043.7 (2053.0) MB, 500.7 / 0.0 ms (average mu = 0.193, current mu = 0.014) allocation failure scavenge might not succeed <--- JS stacktrace ---> FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory 1: 00007FF65ACF412F napi_wrap+133311 2: 00007FF65AC8DD06 SSL_get_quiet_shutdown+63062 3: 00007FF65AC8EB9D node::OnFatalError+301 4: 00007FF65B5719CE v8::Isolate::ReportExternalAllocationLimitReached+94 5: 00007FF65B5567BD v8::SharedArrayBuffer::Externalize+781 6: 00007FF65B3FFFCC v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1516 7: 00007FF65B3EAA4B v8::internal::NativeContextInferrer::Infer+59739 8: 00007FF65B3CFD1F v8::internal::MarkingWorklists::SwitchToContextSlow+56975 9: 00007FF65B3E3A0B v8::internal::NativeContextInferrer::Infer+31003 10: 00007FF65B3DAAED v8::internal::MarkCompactCollector::EnsureSweepingCompleted+6285 11: 00007FF65B3E2C5E v8::internal::NativeContextInferrer::Infer+27502 12: 00007FF65B3E6CAB v8::internal::NativeContextInferrer::Infer+43963 13: 00007FF65B3F06A2 v8::internal::ItemParallelJob::Task::RunInternal+18 14: 00007FF65B3F0631 v8::internal::ItemParallelJob::Run+641 15: 00007FF65B3C3C93 v8::internal::MarkingWorklists::SwitchToContextSlow+7683 16: 00007FF65B3DAF9C v8::internal::MarkCompactCollector::EnsureSweepingCompleted+7484 17: 00007FF65B3D97D4 v8::internal::MarkCompactCollector::EnsureSweepingCompleted+1396 18: 00007FF65B3D7348 v8::internal::MarkingWorklists::SwitchToContextSlow+87224 19: 00007FF65B405DB1 v8::internal::Heap::LeftTrimFixedArray+929 20: 00007FF65B407EA5 v8::internal::Heap::PageFlagsAreConsistent+789 21: 00007FF65B3FD0C1 v8::internal::Heap::CollectGarbage+2049 22: 00007FF65B3FB2C5 v8::internal::Heap::AllocateExternalBackingStore+1349 23: 00007FF65B415155 v8::internal::GCIdleTimeHandler::ShouldDoContextDisposalMarkCompact+1029 24: 00007FF65B4155A5 v8::internal::Factory::AllocateRaw+37 25: 00007FF65B426DA6 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray+38 26: 00007FF65B426EBF v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawFixedArray+31 27: 00007FF65B4169E1 v8::internal::Factory::CopyFixedArrayAndGrow+65 28: 00007FF65B23F7E4 v8::internal::WeakArrayList::AddToEnd+3300 29: 00007FF65B44CC2A v8::internal::Isolate::CaptureSimpleStackTrace+1146 30: 00007FF65B44C971 v8::internal::Isolate::CaptureSimpleStackTrace+449 31: 00007FF65B44C0BD v8::internal::Isolate::CaptureAndSetSimpleStackTrace+45 32: 00007FF65B4428A0 v8::internal::MessageLocation::MessageLocation+3664 33: 00007FF65B4463BC v8::internal::MessageFormatter::Format+13100 34: 00007FF65B41ADB6 v8::internal::Factory::NewError+134 35: 00007FF65B424AF2 v8::internal::Factory::NewTypeError+162 36: 00007FF65B446561 v8::internal::MessageHandler::MakeMessageObject+337 37: 00007FF65B14BF7C v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+9596 38: 00007FF65B5FCDFD v8::internal::SetupIsolateDelegate::SetupHeap+474253 39: 00007FF65B58D1C9 v8::internal::SetupIsolateDelegate::SetupHeap+16473 40: 00007FF65B592FC2 v8::internal::SetupIsolateDelegate::SetupHeap+40530 41: 0000028B13D4D930 40% building 35/38 modules 3 active D:\code\code\wms0217\wms_version1\node_modules\css-loader\dist\runtime\api.jsDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api 40% building 44/47 modules 3 active ...ion1\node_modules\vue-loader\lib\index.js??vue-loader-options!D:\code\code\wms0217\wms_version1\node_modules\eslint-loader\index.js??ref--14-0!D:\code\code\wms0217\wms_version1\src\layout\SideBar\index.vueDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api 40% building 52/54 modules 2 active ...?ref--1-0!D:\code\code\wms0217\wms_version1\node_modules\vue-loader\lib\index.js??vue-loader-options!D:\code\code\wms0217\wms_version1\src\layout\SideBar\index.vue?vue&type=template&id=09aa5453&scoped=trueDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api 40% building 56/59 modules 3 active ...oader\dist\cjs.js??ref--1-0!D:\code\code\wms0217\wms_version1\node_modules\vue-loader\lib\index.js??vue-loader-options!D:\code\code\wms0217\wms_version1\src\layout\SideBar\index.vue?vue&type=script&lang=jsDeprecation Warning [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0. More info: https://sass-lang.com/d/legacy-js-api
最新发布
07-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值