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: rdb files can not be saved because of permission issues bug: redis can not save RDB files #318
* refactor: move db and redis dumps to /appdata directory
* feat: add user groups
* wip: add unit tests
* wip: add more tests and normalized name for creation and update
* test: add unit tests for group router
* fix: type issues, missing mysql schema, rename column creator_id to owner_id
* fix: lint and format issues
* fix: deepsource issues
* fix: forgot to add log message
* fix: build not working
* chore: address pull request feedback
* feat: add mysql migration and fix merge conflicts
* fix: format issue and test issue
* feat: make tasks script run in docker
* feat: make websocket server work in docker
* fix: format issue
* fix: broken lockfile
* fix: non matching typescript versions
* config: add dockerfile
* feat: add working dockerfile for nest and next app with sqlite migration
---------
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>