PM2 restarts after reaching memory limit for longer duration runs (stress test). Issue not visible in kubernetes
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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