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

node ./scripts/build-assets.mjs コマンドを実行すると、JavaScript heap out of memory エラーが発生します。 #13278

Closed
1 task
Lastorder-DC opened this issue Feb 12, 2024 · 6 comments
Labels
⚠️bug? This might be a bug

Comments

@Lastorder-DC
Copy link

Lastorder-DC commented Feb 12, 2024

💡 Summary

node ./scripts/build-assets.mjs コマンドを実行すると、実行に時間がかかり、最終的に次のエラーが発生します。

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory.

🥰 Expected Behavior

コマンドの実行がエラーなく完了しました

🤬 Actual Behavior

次のエラーが発生しました

<--- Last few GCs --->

[1948371:0x44c23660]  1578034 ms: Mark-Compact (reduce) 569.1 (603.6) -> 569.1 (597.6) MB, 457.71 / 0.00 ms  (average mu = 0.974, current mu = 0.049) last resort; GC in old space requested
[1948371:0x44c23660]  1578420 ms: Mark-Compact (reduce) 569.1 (597.6) -> 569.1 (597.1) MB, 386.39 / 0.00 ms  (average mu = 0.948, current mu = 0.000) last resort; GC in old space requested


<--- JS stacktrace --->

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0xc8240c node::Abort() [node]
 2: 0xb724fc void node::FPrintF<>(_IO_FILE*, char const*) [node]
 3: 0xe7ec6c v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 4: 0xe7ee3c v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 5: 0x1077104 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 6: 0x1055390 v8::internal::Factory::CodeBuilder::AllocateInstructionStream(bool) [node]
 7: 0x10557a4 v8::internal::Factory::CodeBuilder::BuildInternal(bool) [node]
 8: 0x1055d30 v8::internal::Factory::CodeBuilder::Build() [node]
 9: 0x17383f4 v8::internal::RegExpMacroAssemblerARM64::GetCode(v8::internal::Handle<v8::internal::String>) [node]
10: 0x142b920 v8::internal::RegExpCompiler::Assemble(v8::internal::Isolate*, v8::internal::RegExpMacroAssembler*, v8::internal::RegExpNode*, int, v8::internal::Handle<v8::internal::String>) [node]
11: 0x1452dfc v8::internal::RegExpImpl::Compile(v8::internal::Isolate*, v8::internal::Zone*, v8::internal::RegExpCompileData*, v8::base::Flags<v8::internal::RegExpFlag, int>, v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::String>, bool, unsigned int&) [node]
12: 0x1453398 v8::internal::RegExpImpl::CompileIrregexp(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSRegExp>, v8::internal::Handle<v8::internal::String>, bool) [node]
13: 0x1453ee0 v8::internal::RegExpImpl::IrregexpPrepare(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSRegExp>, v8::internal::Handle<v8::internal::String>) [node]
14: 0x1454048 v8::internal::RegExpImpl::IrregexpExec(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSRegExp>, v8::internal::Handle<v8::internal::String>, int, v8::internal::Handle<v8::internal::RegExpMatchInfo>, v8::internal::RegExp::ExecQuirks) [node]
15: 0x147a514 v8::internal::Runtime_RegExpExec(int, unsigned long*, v8::internal::Isolate*) [node]
16: 0x1868a84  [node]

📝 Steps to Reproduce

  1. 最新のdevelopブランチで node ./scripts/build-assets.mjs を実行します。
  2. 待つ
  3. かなりの時間が経った後、エラーが発生します。

💻 Frontend Environment

* Model and OS of the device(s): Windows 11 Desktop
* Browser: Chrome 121
* Server URL: k.yumeka.xyz
* Misskey: 2024.2.0-beta.11 (4f80b6fa5d1195c8372a14c6e32b0e7a8287b906)

🛰 Backend Environment (for server admin)

* Installation Method or Hosting Service: systemd
* Misskey: 2024.2.0-beta.11 (4f80b6fa5d1195c8372a14c6e32b0e7a8287b906)
* Node: v20.10.0
* PostgreSQL: 15.6
* Redis: 7.2.4
* OS and Architecture: Ubuntu 20.04 arm64 (memory 24GB)

Do you want to address this bug yourself?

  • Yes, I will patch the bug myself and send a pull request
@Lastorder-DC Lastorder-DC added the ⚠️bug? This might be a bug label Feb 12, 2024
@anatawa12
Copy link
Member

tgz作るのに必要なメモリがない感じかな

@Lastorder-DC
Copy link
Author

総メモリ24GB、空きメモリ16~17GBでメモリ不足はないと思います。

@KisaragiEffective
Copy link
Sponsor Collaborator

https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes を設定してみるのはどうでしょう?

@mei23
Copy link
Contributor

mei23 commented Feb 12, 2024

Debian 12 base / 物理メモリ16GB で10秒で終わるわね

@mei23
Copy link
Contributor

mei23 commented Feb 12, 2024

入れたばっかりだからWindowsであまりチェックしてないのかも
#13260

@Lastorder-DC
Copy link
Author

過去にmisskeyインストールフォルダをホームディレクトリとして使用した痕跡として、.local.cacheフォルダがmisskeyフォルダに残っていました。

それぞれ約2GBくらい、合計4GBです。たぶん、tarballの過程でこのフォルダが間違って含まれてエラーが出たようです。 misskeyインストールフォルダに大容量のフォルダが入らないように注意しなければなりません。

@Lastorder-DC Lastorder-DC closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
None yet
Development

No branches or pull requests

4 participants