Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build and deploy - not enough memory #132

Closed
ryanchristo opened this issue Sep 4, 2019 · 6 comments
Closed

Unable to build and deploy - not enough memory #132

ryanchristo opened this issue Sep 4, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@ryanchristo
Copy link
Contributor

ryanchristo commented Sep 4, 2019

Description

The build process is currently broken due to a lack of memory. The size of this project has grown considerably and running gatsby build now results in errors both locally and remotely.

The latest commit on the generator branch (d80911c) produced the following error on CircleCI:

Build timed out after 5h0m0s

Recent pull requests (#121 and #131) produced the following error on CircleCI:

Error: ENOMEM: not enough memory, read

Attempting to build locally produced the following error:

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

The issue was reported in gatbsy#13980 with potential solutions related to versions, changing the CPU count, and increasing max-old-space-size but no final solution was provided.

@ryanchristo ryanchristo added the bug Something isn't working label Sep 4, 2019
@ryanchristo
Copy link
Contributor Author

ryanchristo commented Sep 4, 2019

I was able to successfully build locally after removing ipfs as a dependency but this is obviously not a solution. We need to optimize, increase the memory limit (locally and on CircleCI), and/or start thinking about splitting the website and developer portal into separate repositories.

@ryanchristo
Copy link
Contributor Author

Replacing gatsby build with node --max_old_space_size=7168 node_modules/gatsby-cli build seems to resolve the issue locally, which was a solution mentioned in gatsby#175. I imagine we still should do some optimization but this seems like a viable workaround for now.

@ryanchristo
Copy link
Contributor Author

Still an issue remotely on CircleCI 🤔

@ceolson01
Copy link
Contributor

I'm pretty sure our CI instance is 2cpus & 4096mb

@ryanchristo
Copy link
Contributor Author

#133 was a temporary solution to unblock the build and deploy process. This issue will remain open until we find a solution that will allow us to use ipfs in the developer portal. Finding a solution that will allow us to keep the current setup would be ideal, otherwise, a few alternatives might include the following:

  • Switch CIs or upgrade CircleCI so that we can increase CPUs
  • Move ipfs to the api so that we can store and retrieve ipfs hashes from there
  • Switch to a monorepo so that we can bundle core, website, and portal separately ❤️

@ceolson01
Copy link
Contributor

No longer an issue, after removal of some large dependencies, most notably ipfs. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants