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

Crash with JS heap OOM when editing LaTeX-heavy pages under vitepress dev #4415

Open
4 tasks done
Locietta opened this issue Dec 9, 2024 · 1 comment
Open
4 tasks done
Labels
build Related to the build system needs more discussion

Comments

@Locietta
Copy link

Locietta commented Dec 9, 2024

Describe the bug

Recently, I wrote posts in my vitepress blog with lots of LaTeX. While these LaTeX-heavy pages can be built and bundled without issue, I periodically get OOM when edit those pages with vitepress dev. (OOM doesn't happen on the initial launch, it often occurs after several edits. Is there memory leaking during hmr or something?)

Crash Log:

<--- Last few GCs --->
ince start of marking 674 ms) (average mu = 0.373[8712:000001C960111000]  1240866 ms: Mark-Compact (reduce) 4093.1 (4097.3) -> 4092.2 (4097.3) MB, pooled: 0 MB, 610.60 / 0.00 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 615 ms) (average mu = 0.394[8712:000001C960111000]  1241870 ms: Mark-Compact 4092.2 (4097.3) -> 4092.2 (4098.3) MB, pooled: 0 MB, 594.69 / 0.00 ms  (average mu = 0.401, current mu = 0.408) allocation failure; GC in old space requested


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 00007FF75678199B node::SetCppgcReference+15707
 2: 00007FF7566EB928 DSA_meth_get_flags+97560
 3: 00007FF7573EC801 v8::Isolate::ReportExternalAllocationLimitReached+65
 4: 00007FF7573D9046 v8::Function::Experimental_IsNopFunction+2710
 5: 00007FF75720FED0 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+34016
 6: 00007FF7572091CD v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+6109
 7: 00007FF7572050ED v8::Platform::SystemClockTimeMillis+655117
 8: 00007FF756A2044D BIO_ssl_shutdown+189
 9: 00007FF75720CA64 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+20596
10: 00007FF7572224C6 v8::Isolate::GetHeapProfiler+8150
11: 00007FF7572225FE v8::Isolate::GetHeapProfiler+8462
12: 00007FF757233547 v8::Isolate::GetHeapProfiler+77911
13: 00007FF756EDB2C8 v8::internal::Version::GetString+447528
14: 00007FF6F747027A
 ELIFECYCLE  Command failed with exit code 134.

Periodically losing LaTeX preview makes it kinda hard to write math-heavy posts. Can you guys help?

Reproduction

Example pages with OOM issue:

Expected behavior

Not OOM under vitepress dev when editing LaTeX-heavy pages.

System Info

System:
    OS: Windows 11 10.0.22635
    CPU: (16) x64 AMD Ryzen 7 7435HS
    Memory: 10.12 GB / 23.74 GB
  Binaries:
    Node: 23.3.0 - D:\Scoop\apps\nodejs\current\node.EXE
    npm: 10.9.0 - D:\Scoop\apps\nodejs\current\npm.CMD
    pnpm: 9.14.4 - D:\Scoop\shims\pnpm.EXE
  Browsers:
    Edge: Chromium (130.0.2849.68)
    Internet Explorer: 11.0.22621.3566
  npmPackages:
    vitepress: 1.5.0 => 1.5.0

Additional context

No response

Validations

@Locietta Locietta added the bug: pending triage Maybe a bug, waiting for confirmation label Dec 9, 2024
@Locietta
Copy link
Author

Switching from MathJax3 to KaTeX seems to mitigate the issue.

@brc-dd brc-dd added build Related to the build system needs more discussion and removed bug: pending triage Maybe a bug, waiting for confirmation labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to the build system needs more discussion
Projects
None yet
Development

No branches or pull requests

2 participants