Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

high CPU usage when enable vetur extension #216

Closed
wyntau opened this issue May 30, 2017 · 19 comments
Closed

high CPU usage when enable vetur extension #216

wyntau opened this issue May 30, 2017 · 19 comments

Comments

@wyntau
Copy link

wyntau commented May 30, 2017

Code Version: 1.12.2

You see, I have disabled all my extensions.

when I enable vetur, the CPU usage is 100%+, when I disabled vetur again, the CPU will back to normal.

a

vetur

@octref
Copy link
Member

octref commented May 30, 2017

Can you show me your file explorer view so I can take a look at your folder structure?
Also, can you paste jsconfig/tsconfig if you have one in your project?

@zoltanlantos
Copy link

I seem to have a similar issue on some of my projects. When vetur is enabled and vue file is opened/focused the CPU usages goes up to 30-45%, it drops to <1% when vetur is disabled.
I'm using Code 1.12.2 on Windows 10 Pro (1607) atm, but I've been having this issue since vetur 0.6.x and Code 1.11.x, I did not had this on vetur 0.5.x.

I've tried to narrow down the issue, no luck so far. It doesn't seem to occur on latest vue-cli projects with default settings. It does happen on 2 of my more complex solutions where the repo has 2-3 vue projects.

I have these config files in the project roots:
.babelrc
.editorconfig
.eslintignore
.eslintrc.js
.gitignore
.sass-lint.yml
and these in the solution root:
.dockerignore
.gitignore
circle.yml
docker-cloud.yml
docker-compose.yml
Dockerfile

@wyntau
Copy link
Author

wyntau commented May 31, 2017

image

I have a little large project, some files are .vue. And I have no tsconfig or jsconfig in whole project.

I think the problem is related to vue language server crash. Because the CPU usage will continue very high before vue language server crash.

Every time the Code console said vue language server crashed, the CPU usage will be low. then the vue language server restarted.
After vue language server crashed some times enough, Code will not restart vue language server again, then the CPU usage is normal always.

vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewByteArray(int, v8::internal::PretenureFlag) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::internal::compiler::DeadCodeElimination::TrimMergeOrPhi(v8::internal::compiler::Node*, int) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::compiler::Linkage::GetParameterSecondaryLocation(int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: v8::internal::compiler::Linkage::GetParameterSecondaryLocation(int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 9: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
10: v8::internal::compiler::SourcePositionTable::Print(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
11: v8::internal::compiler::Operator::PrintPropsTo(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
12: v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
13: v8::internal::RegisterConfiguration::AreAliases(v8::internal::MachineRepresentation, int, v8::internal::MachineRepresentation, int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
14: 0x399be3043a7
[Info  - 上午9:15:19] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewByteArray(int, v8::internal::PretenureFlag) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::internal::compiler::DeadCodeElimination::TrimMergeOrPhi(v8::internal::compiler::Node*, int) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::compiler::Linkage::GetParameterSecondaryLocation(int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: v8::internal::compiler::Linkage::GetParameterSecondaryLocation(int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 9: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
10: v8::internal::compiler::SourcePositionTable::Print(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
11: v8::internal::compiler::Operator::PrintPropsTo(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
12: v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
13: v8::internal::RegisterConfiguration::AreAliases(v8::internal::MachineRepresentation, int, v8::internal::MachineRepresentation, int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
14: 0x14036b7043a7
15: 0x14036c0a14c3
16: 0x14036c099b72
17: 0x14036c0d22ac
18: 0x14036c158629
19: 0x14036c09a081
20: 0x14036c099ce5
[Info  - 上午9:16:06] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewTransitionArray(int) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::TracingCpuProfiler::Create(v8::Isolate*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 9: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
10: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
11: v8::internal::LookupIterator::PrepareTransitionToDataProperty(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
12: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
13: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
14: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
15: 0x306b4a1843a7
16: 0x306b4aad24aa
17: 0x306b4aad265a
18: 0x306b4acaaea4
[Info  - 上午9:17:00] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewTransitionArray(int) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::TracingCpuProfiler::Create(v8::Isolate*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 9: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
10: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
11: v8::internal::LookupIterator::PrepareTransitionToDataProperty(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
12: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
13: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
14: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
15: 0xaff7d7043a7
[Info  - 上午9:17:46] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewTransitionArray(int) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::TracingCpuProfiler::Create(v8::Isolate*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 9: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
10: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
11: v8::internal::LookupIterator::PrepareTransitionToDataProperty(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
12: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
13: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
14: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
15: 0x2402c90043a7
[Info  - 上午9:18:31] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::internal::RegisterConfiguration::AreAliases(v8::internal::MachineRepresentation, int, v8::internal::MachineRepresentation, int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: 0x232ed70083a6
 8: 0x232ed792e3c0
 9: 0x232ed720f41f
10: 0x232ed792938c
11: 0x232ed7930068
[Info  - 上午9:19:32] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::internal::RegisterConfiguration::AreAliases(v8::internal::MachineRepresentation, int, v8::internal::MachineRepresentation, int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: 0x152d1ae083a6
 8: 0x152d1b8f3520
 9: 0x152d1b5d831f
10: 0x152d1b88746c
11: 0x152d1b8f2128
[Info  - 上午9:20:16] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::internal::compiler::Node::Uses::empty() const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::RegisterConfiguration::AreAliases(v8::internal::MachineRepresentation, int, v8::internal::MachineRepresentation, int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: 0x18fa32d043a7
[Info  - 上午9:21:03] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewTransitionArray(int) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::TracingCpuProfiler::Create(v8::Isolate*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 9: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
10: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
11: v8::internal::LookupIterator::PrepareTransitionToDataProperty(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
12: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
13: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
14: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
15: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
16: 0x3e3bc7c043a7
[Info  - 上午9:21:54] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewTransitionArray(int) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::TracingCpuProfiler::Create(v8::Isolate*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 9: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
10: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
11: v8::internal::LookupIterator::PrepareTransitionToDataProperty(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
12: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
13: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
14: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
15: 0x265c952043a7
16: 0x265c95c73fea
17: 0x265c95c7419a
18: 0x265c95d2a984
19: 0x265c95c7cf7d
[Info  - 上午9:22:40] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewByteArray(int, v8::internal::PretenureFlag) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::internal::compiler::DeadCodeElimination::TrimMergeOrPhi(v8::internal::compiler::Node*, int) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::compiler::Linkage::GetParameterSecondaryLocation(int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: v8::internal::compiler::Linkage::GetParameterSecondaryLocation(int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 9: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
10: v8::internal::compiler::SourcePositionTable::Print(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
11: v8::internal::compiler::Operator::PrintPropsTo(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
12: v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
13: v8::internal::RegisterConfiguration::AreAliases(v8::internal::MachineRepresentation, int, v8::internal::MachineRepresentation, int) const [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
14: 0x34e6c0c043a7
15: 0x34e6c165e8c3
[Info  - 上午9:23:26] Connection to server got closed. Server will restart.
vetur initialized
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 2: node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 3: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 4: v8::internal::FatalProcessOutOfMemory(char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 5: v8::internal::Factory::NewTransitionArray(int) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 6: v8::TracingCpuProfiler::Create(v8::Isolate*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 7: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 8: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
 9: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
10: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
11: v8::internal::LookupIterator::PrepareTransitionToDataProperty(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
12: v8::internal::HeapNumber::HeapNumberPrint(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
13: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
14: v8::internal::OldSpaces::next() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
15: 0x3bb7510043a7
16: 0x3bb7516e90aa
17: 0x3bb7518b8a19
18: 0x3bb751a54b24
19: 0x3bb7516f477d
[Info  - 上午9:24:17] Connection to server got closed. Server will restart.
vetur initialized

@octref
Copy link
Member

octref commented Jun 1, 2017

@zoltanlantos

When you have a project that has multiple sub project this seems to happen. Is it that you are having the trouble on this kind of repo?

/myapp
  /app1
    package.json
    tsconfig.json
  /app2
    package.json
    tsconfig.json

If so, what's your tsconfig/jsconfig/package.json like if you do have them for your sub-project?

@octref
Copy link
Member

octref commented Jun 1, 2017

@treri Can you try putting a jsconfig.json at your project root, where you specify to only include the relevant files, like so?

This usually happens if some other large files are included by mistake.

{
  "include": [
      "./src/**/*"
  ]
}

@wyntau
Copy link
Author

wyntau commented Jun 2, 2017

@octref Great! The CPU usage will be normal IF I have a jsconfig.json

{
  "include": [
      "./static/page/**/*"
  ]
}

Every time I open a vue file, the CPU usage will be 60% ~ 100% more or less, and some later it will back normal, it will not always be very high 😁.

The result was acceptable for me. thanks

@zoltanlantos
Copy link

@octref Setting a jsconfig.json in root to only include the folders that have the Vue projects seems to be mitigating the issue. Setting them in the subproject folder doesn't have this effect.
My test seems to coincide with what you are saying about some other files are included by mistake. It does seem to happen only on solutions with mixed stack and lots of misc files. I've tried to find which files/folders are causing the problem by exclusion (removing folders one-by-one), without luck. It seems to only happen if there are lot of files/folders.

I don't have tsconfig files. The project where I can consistently reproduce this issue has this structure:

/.sass-cache
/admin-frontend 
   project.json # the vue-cli webpack project
/app # php project
/app-frontend # php project
/deploy # some deploy sh files
/dist
/docker
/frontend 
   project.json # a fairly typical AngularJS project with gulp, eslint and browser-sync
   bower.json
/src # some php class files
/vendor # composer dependency folder
/web # with lots of static asset files
bower.json
composer.json
package.json # whit some grunt dependencies

This project has a long history :)

@octref
Copy link
Member

octref commented Jun 2, 2017

@zoltanlantos

Um, where is your vue project?
Say all your vue files are in /app, try having this as jsconfig.json at your project root:

{
  "include": [
      "./app/**/*.vue"
  ]
}

@zoltanlantos
Copy link

@octref it's in /admin-frontend so I've added

{
  "include": [
      "./admin-frontend/src/**/*",
  ]
}

It does seem to fix the issue, as @treri said, there is only an initial spike that goes away in about 2sec.
Is it a requirement to have jsconfig.json or just a workaround? There are other JavaScript project in the solution (/frontend is AngualrJS). I'm not sure if limiting jsconfig.json to the vue project would affect them.

I'll see if I can list the other js projects in includes or exclude the no-js projects. The docs says that jsconfig.json marks the root of the js project, so I wonder if I can make this work in the sub dirs.

I appreciate you help, cheers!

@octref
Copy link
Member

octref commented Jun 2, 2017

Yeah this is less than ideal. Currently the TypeScript language server takes in everything in your workspace unless you specify a jsconfig/tsconfig. I'm looking into only include *.vue files and the files that they import.

@danielpost
Copy link

I'm having the same issue, but adding a jsconfig.json to only point at my Vue files does not solve the issue. It also doesn't happen immediately, but anywhere between 5 mins and a few hours after I start working. I think it's related to the Vue server or something like that.

@gbezyuk
Copy link

gbezyuk commented Jul 16, 2017

Same issue here, happening right after opening a vue-based project. Wasn't the case some weeks ago, so probably was caused by some version bump.

➜  ~  ps aux | grep 90465
gbezyuk          90465 100.0  0.8  3322408 137484   ??  R     2:07PM   1:04.45 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/gbezyuk/.vscode/extensions/octref.vetur-0.9.1/client/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/gbezyuk/.vscode/extensions/octref.vetur-0.9.1/client/node_modules/vue-language-server/dist/vueServerMain.js --node-ipc

@octref
Copy link
Member

octref commented Jul 16, 2017

@gbezyuk
Create a jsconfig.json that only includes your project front end code, or explicitly exclude your bower_components and other folders similar to node_modules.

@gbezyuk
Copy link

gbezyuk commented Jul 17, 2017

@octref thanx, but may I suggest an idea of excluding bower_components, node_modules, or whatever else what is not .vue files by default without asking a developer who normally doesn't even know about the existence of this extension to create any extra files?

@wyntau
Copy link
Author

wyntau commented Jul 17, 2017

Yeah this is less than ideal. Currently the TypeScript language server takes in everything in your workspace unless you specify a jsconfig/tsconfig. I'm looking into only include *.vue files and the files that they import.
@gbezyuk

@wyntau wyntau closed this as completed Jul 17, 2017
@wyntau wyntau reopened this Jul 17, 2017
@gh67uyyghj
Copy link

gh67uyyghj commented Jul 18, 2017

This issue is still happening even when excluding "node_modules" or including src directory of a very small project

@octref
Copy link
Member

octref commented Jul 19, 2017

@eronaeon Can you try to provide a repro case?

@octref
Copy link
Member

octref commented Aug 5, 2017

If the jsconfig/tsconfig approach does not work for you, and you are on latest version, open a new issue with repro steps & a sample project.

@octref octref closed this as completed Aug 5, 2017
@fractalf
Copy link

fractalf commented May 7, 2018

Just want to add that this empty array fixes the bug for me on Linux Mint (VSCode 1.23.0, Vetur 0.11.7)
Remember to put the jsconfig.json in the root of the "Open folder..." folder :)

{
    "include": []
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants