-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
JavaScript heap out of memory #12566
Comments
Hey @TemporalAgent7 So while this out of memory should definitely be fixed, I think You should look into your queries, because pulling >700KB of data for each site seems pretty heavy? |
I trimmed the queries down to only the needed fields, and the situation didn't really improve. Now the build sometimes fails on Netlify (due to their 15 minute timeout); the most expensive step is still the run graphql queries (709.850 s — 726/726 1.02 queries/second). I have a many-to-many relationship between 2 large JSON lists, and that currently results in duplication across the pages. Do you have any recommendations about how I could be optimizing that with GraphQL and mappings? Or am I better off dumping the JSON files in output, and loading them dynamically? Thank you! |
FWIW, I ended up uploading and fetching the other JSON at runtime, which reduced the query step duration 100x (from 12 minutes to 7 seconds); it looks like mapping joins (in particular self-referencing joins) are terrible performance-wise. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
Hey, i have site with quite large data to be queried from contentful. |
@vinutha93bnvs could you please open a new issue with more detail and a reproduction if you'd like additional help? Thank you! As far as this issue--we believe it to be mostly closed with some changes related to stringifying data that @pieh implemented in #10732 which seems to scale Gatsby much more effectively. As such--closing this out. Thanks for all the help/info everyone! |
Description
I believe
gatsby develop
may have a memory leak. I'm seeing the same thing on different machines (16Gb and 32Gb RAM); the graphql queries step runs until the node process reaches roughly ~1.5GB memory usage then crashes with a message like:gatsby build
does succeed; the node process maintains a constant memory usage (of around 320Mb) and constantly pegs a single core of the CPU while running 727 GraphQL queries for 10+ minutes, but it eventually completes successfully.I suspect I'm doing something silly with GraphQL mappings (I only just started using Gatsby and GraphQL a few days ago) - I'm trying to join 3 json sources. If there's an "optimizer" / "analyzer" for GraphQL that could point me to my mistakes, please let me know.
I'm also looking into options for increasing Node's V8 memory allocation in case that contributes to the problem.
Steps to reproduce
Expected result
No crashes.
Actual result
V8 out of memory.
Environment
The text was updated successfully, but these errors were encountered: