mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #9119] [CLOSED] feat:Increase Node.js heap size to avoid memory allocation errors during build #37951
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/9119
Author: @ClaiNu04
Created: 1/30/2025
Status: ❌ Closed
Base:
main← Head:main📝 Commits (1)
b68173efeat:Increase Node.js heap size to avoid memory allocation errors during build📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
Dockerfile(+1 -1)📄 Description
DESCRIPTION
This pull request addresses an issue that may arise when building the project, especially for larger repositories or environments with higher memory usage during the build process. Specifically, the build process in Node.js might run out of memory, causing the compilation to fail, as seen in some cases where the project requires more heap space than the default allocation.
To resolve this, I've added the following environment variable:
**NODE_OPTIONS=--max-old-space-size=4096**This adjustment increases the available heap size for the Node.js process, preventing the out-of-memory error
**(101.7 fatal error: ineffective mark-compacts near heap limit allocation failed - javascript heap out of memory)**during the build process. It's a simple but effective way to ensure more stable builds, particularly for large projects or machines with limited available memory.Why this change is useful:
Fixes build failures: In some environments, especially when dealing with larger or more complex projects, this change prevents memory-related build failures.
Minimal impact: This change only affects the build process and won't interfere with the runtime or production environment.
Widely applicable: Many developers may face similar memory issues when building large repositories, and this fix can be applied universally.
Considerations:
If your environment has limited resources (especially RAM), please note that this change may not be necessary and could be adjusted based on specific needs.
We recommend monitoring the build process after this change to ensure no further issues arise in other environments.
I believe this small but crucial adjustment will make the build process more resilient and should prevent the "out-of-memory" issue some users may face. I’m happy to discuss or modify the change further if needed.
Thanks for considering this improvement!
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.