Repository navigation
Build Failing in CI Due to Memory Issues (~14k MD files) – Works Locally #11745
Replies: 2 comments
|
Hey 👋 It's impossible to help with this kind of issue without knowing more about your site and having access to its source. Set Why do you have 14k md files? Are they written manually or codegen? We have recently found out that codegen of large mdx documents can be a huge problem for performance. An OpenAPI plugin changed its strategy and became much faster. #11664 |
|
Had this exact issue with large doc builds crashing in CI while passing locally on my laptop. The reason it passes on your local machine with less RAM but fails on a 32GB CI runner comes down to CPU core count. Self-hosted CI runners usually have 16 or 32 vCPU cores. Docusaurus and Webpack spawn worker threads based on Here is how to stabilize the build: 1. Limit worker thread count in CITell Node and Webpack not to use every single core on the host runner. In your CI workflow step, cap the thread pool: env:
UV_THREADPOOL_SIZE: 4
run: npm run build -- --parallelism 42. Check for local search pluginsIf you are using a local full-text search plugin like Try running a test build with the search plugin temporarily commented out in Give the worker cap a try first, that usually resolves the runner OOM immediately. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
We’re running into memory issues when building our Docusaurus site in CI and would appreciate some guidance.
Context
-Node version: 22
-Docs size: ~14,000 markdown files
Problem
The build works fine locally, but it fails in GitHub Actions due to memory issues.
We are using our own runner with 32 GB RAM, so we were not expecting memory to be a bottleneck.
What We’ve Tried
node --max-old-space-size=16384Still failing. Given that the runner has 32 GB RAM, we suspect this might not be the real issue.
2.Added swap space in CI:
pierotofy/set-swap-spaceThis does allow the build to succeed.
However:
We did memory analysis, we are seeing ram is eaten up during docusaurus build (this is without swap space)
All reactions