How to solve the Memory Leak problem on Node.js while running Jest
A step-by-step guide to solving the JavaScript heap out-of-memory error while running test cases on Node JS
It looked like another typical day, with different deployments. However, we were surprised by a CircleCI error while running some of our E2E test cases. After re-running the deployment process multiple times, we realized it began to fail randomly without any explanation. The test cases worked perfectly in our local environments, but this is what appeared on CircleCI:
After looking at the logs, we found a JavaScript heap out-of-memory error. Reached heap limit allocation failed? Why is this problem happening in CircleCI, and it didn’t happen in our local environments? Let’s try to understand and optimize this process!
This tutorial is going to be divided into the following points: