question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CircleCI Crashes on Ubuntu instances due to Memory Usage

See original GitHub issue

Ask your Question

The CircleCI boxes that are used for ubuntu testing (specifically our android build) have 36 cores. When we are running our yarn bundle --platform=android build, we are running out of memory with this error:

./node_modules/react-native/Libraries/Utilities/stringifySafe.js
Module build failed (from ./node_modules/haul/node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 32)
ENOMEM: not enough memory, read

We don’t see this problem on our other workstations, that have 8 cores.

When we modified the thread-loader options to only have 1 worker, we no longer see this issue.

How do you recommend that we modify the configuration to have less thread-workers? What strategies do people normally use to merge in webpack config settings? webpack-merge?

Currently we are doing this:

export default {
  webpack: env => {
    const config = createWebpackConfig({
      entry: `./index.js`
    })(env)
    config.module.rules[1].use[1].options.workers = 1
    // A bunch of other rules and settings
  }
}

But this is obviously sub-optimal.

Thanks for looking and helping!

James

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
hjhartcommented, Apr 6, 2019

Yeah, I can submit a pull request. Much friendlier than manipulating nested JavaScript objects…

On Apr 6, 2019, at 16:28, Tommy Nguyen notifications@github.com wrote:

Ah, I completely missed the number of cores. Sorry about that. The thread count is set in src/utils/makeReactNativeConfig.js:

{ loader: require.resolve(‘thread-loader’), options: { workers: Math.max(os.cpus().length - 1, 1), }, }, It looks like we’re counting logical cores and subtract one. Should be simple to make configurable. What do you think, @thymikee? @hjhart, would you like to give it a try?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

1reaction
tido64commented, Apr 3, 2019

I seem to recall reading something about Webpack having memory leaks. Which version are you using? Could you try upgrading and see if that helps?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Workflow stops/crashes seemingly randomly - CircleCI Discuss
I'm experiencing that the automated test runs we run on PRs sometimes fails/crashes. To me it seems the docker instance just kills itself ......
Read more >
Exit Code 137 - Out of Memory – CircleCI Support Center
This is a Linux error code which you may see on CircleCI when your container runs out of memory. Containers are given 4GB...
Read more >
Containers running out of memory on 14.04 image but runs ...
Using Ubuntu some containers run out of memory with capybara-webkit and rspec showing taking all of the memory. The error message is Your ......
Read more >
Builds died unexpectedly - Build Environment - CircleCI Discuss
We have taken a snapshot of the memory usage at the time, which you can find in a build artifact named `memory-usage.txt`.
Read more >
CircleCI Release Notes
Server v4.x makes improved use of Kubernetes secrets and removes the requirement to ... that was causing pods to crash as a result...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found