Skip to content

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

@viktoriavikulya

Description

@viktoriavikulya

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions