Skip to content

Memory usage grows unbounded in long-running background worker #3

Description

@Katomoto

The background processing worker shows steady memory growth (~20MB/hour) that eventually triggers OOM restarts after ~48 hours of uptime.

Observed in production via memory metrics — heap usage grows linearly with no plateau.

Likely causes:

  1. Event listeners added in the processing loop but never removed
  2. Accumulated references in the job queue not being garbage collected
  3. Large response bodies being held in closure scope longer than needed

Reproduction: run the worker locally with node --inspect and take heap snapshots at 0, 30, and 60 minutes to identify retained objects.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions