Add --max-old-space-size=1024 to the node process running the Next.js
server. This caps V8's old-generation heap at 1024MB, forcing the
garbage collector to run more aggressively as memory usage approaches
the limit.
Previously, users saw Next.js RSS grow to 4GB+. This was caused by a
reference chain that prevented GC from freeing memory:
AfterContext (vercel/next.js#89091) retained ServerResponse objects
after client disconnect, which held zlib Transform streams (from
compress: true), which allocated native C++ buffers outside V8's
heap entirely — invisible to GC and uncapped by --max-old-space-size.
Combined with the prior commit's fixes (compress: false moves gzip to
nginx, httpBatchLink closes connections faster, socket-cleanup.cjs
destroys zombie CLOSE_WAIT sockets every 60s), GC can now actually
reclaim memory because:
- zlib native buffers no longer exist (compress: false)
- The AfterContext → ServerResponse reference chain is broken by
socket cleanup destroying the underlying sockets
- The JS heap is capped at 1024MB so V8 GCs more frequently for
the memory it does control
Also fixes the Dockerfile to copy socket-cleanup.cjs from the builder
stage instead of the host context.
Ref: https://github.com/homarr-labs/homarr/issues/3759
Addresses high memory usage by adding gzip compression to nginx (removing it from nextjs)
socket cleanup handling, and tRPC client optimizations.
Ref: https://github.com/homarr-labs/homarr/issues/3759
* fix: skip env validation in dockerfile not working
* fix: skip env validation in dockerfile not working
* fix: remove linux/arm/v7 for now as node commands are run forever
* fix: remove cache because it is to big?
* refactor: remove redis log transport during build
* fix: add more checks for conditional redis connection
* fix: docker build not working locally
* refactor: move base image to debian
* chore: add arm v7 platform support
* fix: remove armv7 support as not supported by turbo
* chore: profile amd64 build
* chore: enable webpack logging
* chore: disable linux/arm64 for now
* chore: remove profiling from build in dockerfile
* chore: revert to node alpine image
* wip: sso
* feat: add ldap client and provider
* feat: implement login form
* feat: finish sso
* fix: lint and format issue
* chore: address pull request feedback
* fix: build not working
* fix: oidc is redirected to internal docker container hostname
* fix: build not working
* refactor: migrate to ldapts
* fix: format and frozen lock file
* fix: deepsource issues
* fix: unit tests for ldap authorization not working
* refactor: remove unnecessary args from dockerfile
* chore: address pull request feedback
* fix: use console instead of logger in auth env.mjs
* fix: default value for auth provider of wrong type
* fix: broken lock file
* fix: format issue