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

JavaScript heap out of memory #1169

Open
ctretyak opened this issue Feb 5, 2025 · 4 comments
Open

JavaScript heap out of memory #1169

ctretyak opened this issue Feb 5, 2025 · 4 comments
Labels
question Further information is requested

Comments

@ctretyak
Copy link

ctretyak commented Feb 5, 2025

I am using Astronvim community tailwind package with default config https://github.com/AstroNvim/astrocommunity/blob/4d8d63458cea63e704e0f08eeaf4d4c3330e19d4/lua/astrocommunity/pack/tailwindcss/init.lua

Regular (every day at least, usually often) tailwind language server is down because of memory:

[ERROR][2025-02-05 09:44:29] .../vim/lsp/rpc.lua:770	"rpc"	"/home/voyager/.local/share/nvim/mason/bin/tailwindcss-language-server"	"stderr"	"
<--- Last few GCs --->

[1341160:0x6de1000] 59744036 ms: Scavenge 4090.7 (4123.6) -> 4090.7 (4127.9) MB, pooled: 0 MB, 1.78 / 0.00 ms  (average mu = 0.997, current mu = 0.960) allocation failure; 
[1341160:0x6de1000] 59744061 ms: Mark-Compact (reduce) 4093.5 (4130.7) -> 4093.5 (4123.7) MB, pooled: 0 MB, 4.28 / 0.00 ms  (+ 0.1 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 25 ms) (average mu = 0.995, curre

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

"
[ERROR][2025-02-05 09:44:29] .../vim/lsp/rpc.lua:770	"rpc"	"/home/voyager/.local/share/nvim/mason/bin/tailwindcss-language-server"	"stderr"	" 1: 0xe1bdfe node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
 2: 0x123e800 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 3: 0x123ead7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 4: 0x146c615  [node]
 5: 0x1485e89 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 6: 0x145a558 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 7: 0x145b485 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 8: 0x143387e v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
 9: 0x1422974 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Tagged<v8::internal::Map>, v8::internal::AllocationAlignment) [node]
10: 0x142487f v8::internal::FactoryBase<v8::internal::Factory>::NewRawTwoByteString(int, v8::internal::AllocationType) [node]
11: 0x143f25a v8::internal::Factory::NewStringFromUtf8(v8::base::Vector<char const>, v8::internal::AllocationType) [node]
12: 0x125ad1d v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) [node]
13: 0x10d0977  [node]
14: 0x10d0aaf node::StringDecoder::DecodeData(v8::Isolate*, char const*, unsigned long*) [node]
15: 0x10d100d  [node]
16: 0x7da90320f745 
"


@thecrypticace
Copy link
Contributor

Interesting. I don't see this… ever. Any chance you could provide some more details about the kind of project(s) you use it on?

@thecrypticace thecrypticace added the question Further information is requested label Feb 5, 2025
@ctretyak
Copy link
Author

ctretyak commented Feb 5, 2025

Interesting. I don't see this… ever. Any chance you could provide some more details about the kind of project(s) you use it on?

This is one of monorepo (turborepo) project. Next.js

@thecrypticace
Copy link
Contributor

  • How large is the project? (number of files, number of packages, etc)
  • Do you have multiple installations of Tailwind CSS in that project or one shared installation?
  • How many tailwind configs do you have in your project?
  • Any chance you could provide LSP logs up to the point where the crash happens?

@ctretyak
Copy link
Author

ctretyak commented Feb 6, 2025

  • How large is the project? (number of files, number of packages, etc)
  • Do you have multiple installations of Tailwind CSS in that project or one shared installation?
  • How many tailwind configs do you have in your project?
  • Any chance you could provide LSP logs up to the point where the crash happens?
  • I think it's medium size. not too big, but it's not a landing. It's about 15-20 pages
  • It's one installation in one of the multirepo projects (apps/web/tailwind.config.js)
  • One config
  • logs before:
[WARN][2024-07-02 09:56:59] ...lsp/handlers.lua:135	"The language server copilot triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN][2024-07-02 09:57:40] .../lua/vim/lsp.lua:604	"buf_attach_client called on unloaded buffer (id: 162): "
[WARN][2024-07-02 09:57:41] .../lua/vim/lsp.lua:604	"buf_attach_client called on unloaded buffer (id: 162): "
[ERROR][2024-07-02 09:57:42] ...lsp/handlers.lua:623	"TSServer exited. Code: null. Signal: SIGTERM"
[START][2024-07-02 09:58:45] LSP logging initiated
[WARN][2024-07-02 09:58:45] ...lsp/handlers.lua:135	"The language server emmet_ls triggers a registerCapability handler for workspace/didChangeConfiguration despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN][2024-07-02 09:58:45] ...lsp/handlers.lua:135	"The language server emmet_ls triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN][2024-07-02 09:58:45] ...lsp/handlers.lua:135	"The language server eslint triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ERROR][2024-07-02 09:58:45] ...lsp/handlers.lua:623	"invalid/unknown file in graphql config documents entry:\n 'apps/web/**/*.{graphql,gql}'"
[ERROR][2024-07-02 09:58:45] ...lsp/handlers.lua:623	"Error: \n      Unable to find any GraphQL type definitions for the following pointers:\n        \n          - apps/web/**/*.{graphql,gql}\n          "
[WARN][2024-07-02 09:58:45] ...lsp/handlers.lua:135	"The language server copilot triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN][2024-07-02 10:02:12] ...m/lsp/client.lua:1023	"server_request: no handler found for"	"workspace/diagnostic/refresh"
[ERROR][2024-07-02 10:02:13] ...lsp/handlers.lua:623	"Unhandled exception: MethodNotFound\nError: MethodNotFound\n    at handleResponse (/home/tretiak.k/.local/share/nvim/mason/packages/json-lsp/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/connection.js:561:48)\n    at handleMessage (/home/tretiak.k/.local/share/nvim/mason/packages/json-lsp/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/connection.js:398:20)\n    at Immediate.<anonymous> (/home/tretiak.k/.local/share/nvim/mason/packages/json-lsp/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/connection.js:368:30)\n    at process.processImmediate (node:internal/timers:478:21)"
[WARN][2024-07-02 10:17:06] ...lsp/handlers.lua:135	"The language server dockerls triggers a registerCapability handler for workspace/didChangeConfiguration despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN][2024-07-02 10:51:01] ...lsp/handlers.lua:135	"The language server eslint triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN][2024-07-02 11:11:33] ...m/lsp/client.lua:1023	"server_request: no handler found for"	"workspace/diagnostic/refresh"
[ERROR][2024-07-02 11:11:33] ...lsp/handlers.lua:623	"Failed to refresh diagnostics"
[WARN][2024-07-02 11:11:33] ...lsp/handlers.lua:135	"The language server emmet_ls triggers a registerCapability handler for workspace/didChangeConfiguration despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN][2024-07-02 11:11:33] ...lsp/handlers.lua:135	"The language server emmet_ls triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN][2024-07-02 11:11:35] ...lsp/handlers.lua:135	"The language server tailwindcss triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ERROR][2024-07-02 11:23:01] ...lsp/handlers.lua:623	"The prop value with an expression type of JSXEmptyExpression could not be resolved. Please file an issue ( https://github.com/jsx-eslint/jsx-ast-utils/issues/new ) to get this fixed immediately."
[ERROR][2024-07-02 11:23:01] ...lsp/handlers.lua:623	"The prop value with an expression type of JSXEmptyExpression could not be resolved. Please file an issue ( https://github.com/jsx-eslint/jsx-ast-utils/issues/new ) to get this fixed immediately."
[ERROR][2024-07-02 11:26:50] .../vim/lsp/rpc.lua:770	"rpc"	"/home/tretiak.k/.local/share/nvim/mason/bin/tailwindcss-language-server"	"stderr"	"\n<--- Last few GCs --->\n\n[214016:0x2ec2cfd0]   917042 ms: Mark-Compact (reduce) 4093.3 (4124.3) -> 4093.3 (4121.3) MB, 4.12 / 0.00 ms  (+ 15.9 ms in 2 steps since start of marking, biggest step 15.9 ms, walltime since start of marking 33 ms) (average mu = 0.870, current mu = 0.54[214016:0x2ec2cfd0]   917069 ms: Mark-Compact (reduce) 4094.2 (4122.3) -> 4094.2 (4122.3) MB, 20.99 / 0.00 ms  (average mu = 0.770, current mu = 0.232) allocation failure; scavenge might not succeed\n\n\n<--- JS stacktrace --->\n\nFATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory\n----- Native stack trace -----\n\n"
[ERROR][2024-07-02 11:26:50] .../vim/lsp/rpc.lua:770	"rpc"	"/home/tretiak.k/.local/share/nvim/mason/bin/tailwindcss-language-server"	"stderr"	" 1: 0xb82c78 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]\n 2: 0xeefa80 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]\n 3: 0xeefd67 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]\n 4: 0x1101905  [node]\n 5: 0x1119788 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]\n 6: 0x10ef8a1 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]\n 7: 0x10f0a35 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]\n 8: 0x10cd156 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]\n 9: 0x10bed84 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [node]\n10: 0x10c2097 v8::internal::FactoryBase<v8::internal::Factory>::NewRawTwoByteString(int, v8::internal::AllocationType) [node]\n11: 0x10d85cb v8::internal::Factory::NewStringFromUtf8(v8::base::Vector<char const> const&, v8::internal::AllocationType) [node]\n12: 0xf02312 v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) [node]\n13: 0xde2ed1  [node]\n14: 0xde2fef node::StringDecoder::DecodeData(v8::Isolate*, char const*, unsigned long*) [node]\n15: 0xde352d  [node]\n16: 0x76124944d546 \n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants