fix: make source maps opt-in to restore v1.67.0 memory baseline
Production source maps (--enable-source-maps) caused a ~50% memory increase (600MB to 1000MB) in v1.68.0. Node.js loads all .map files into memory when this flag is enabled, and Next.js server chunks generate hundreds of map files. Changes: - Guard productionBrowserSourceMaps and serverSourceMaps behind HOMARR_ENABLE_SOURCE_MAPS env var (default off) - Guard .map copy step and NODE_OPTIONS in Dockerfile behind ENABLE_SOURCE_MAPS build arg (default false) - run.sh checks HOMARR_ENABLE_SOURCE_MAPS before setting --enable-source-maps - Add Docker-based memory regression CI job (<700MB threshold) Closes #6123
This commit is contained in:
1 parent
597b5fbc8d
commit
57ef0af4a2
4 files changed
+78
-17
No files matched your search
@@ -58,6 +58,12 @@ terminate() {
|
||||
|
||||
trap terminate TERM INT
|
||||
|
||||
# Enable source maps in Node.js when explicitly opted in.
|
||||
# Default off — see https://github.com/homarr-labs/homarr/issues/6123
|
||||
if [ "${HOMARR_ENABLE_SOURCE_MAPS}" = "true" ]; then
|
||||
export NODE_OPTIONS="--enable-source-maps${NODE_OPTIONS:+ $NODE_OPTIONS}"
|
||||
fi
|
||||
|
||||
node apps/nextjs/server.js &
|
||||
NEXTJS_PID=$!
|
||||
|
||||
|
||||
Reference in new issue
Block a user