Unitech / Unitech/pm2

PM2 restarts after reaching memory limit for longer duration runs (stress test). Issue not visible in kubernetes

Open
#5,133 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

What's going wrong?

We are running long duration stress tests on the application running on PM2. Memory consumption keeps on increasing steadily till it restarts.
The same issue is not visible in kubernetes where the graph remains stable.

Supporting information

Getting the following error before restarts.

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa04200 node::Abort() 
 2: 0x94e4e9 node::FatalError(char const*, char const*) 
 3: 0xb7978e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) 
 4: 0xb79b07 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) 
 5: 0xd34395
 6: 0xd34f1f 
 7: 0xd42fab v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) 

Found the same issue in v4.4.0 and v5.1.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the long-duration stress test under PM2 and compare its memory behavior with Kubernetes, using the reported Node.js out-of-memory trace. Done means identifying whether PM2 contributes to the growth and verifying the behavior after a fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.