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

Generating static HTML for pages - runs out of memory #1651

Closed
Bouncey opened this issue Jul 28, 2017 · 1 comment
Closed

Generating static HTML for pages - runs out of memory #1651

Bouncey opened this issue Jul 28, 2017 · 1 comment

Comments

@Bouncey
Copy link
Contributor

Bouncey commented Jul 28, 2017

Our repo is freecodecamp/guides

I have tried building our site on a platinum tier netlify account with 7GB of memory and the build fails in the same manner as below.

Travis-CI fails in the same manner also.

My machine also failed today after adding more content.

Am I doing something wrong or have we reached the limits of /packages/gatsby/src/utils/build-html.js

$ npm run build

> node seed && gatsby build


navData created

It took 229ms to create the nav data for 2395 pages

success open and validate gatsby-config.js — 0.005 s
success copy gatsby files — 0.042 s
success source and transform nodes — 40.325 s
success building schema — 2.991 s
success createPages — 15.802 s
success createPagesStatefully — 2.169 s
success extract queries from components — 0.279 s
success run graphql queries — 36.647 s
success write out page data — 0.120 s
success update schema — 23.890 s

bootstrap finished, time since started: 123.69 s

Generating CSS
Compiling production bundle.js
[BABEL] Note: The code generator has deoptimised the styling of "/home/stuart/guides/.cache/async-requires.js" as it exceeds the max of "500KB".
Generating static HTML for pages

<--- Last few GCs --->

[5385:0x312b5e0]   379945 ms: Mark-sweep 1400.0 (1570.8) -> 1399.1 (1571.3) MB, 282.3 / 0.1 ms  allocation failure GC in old space requested
[5385:0x312b5e0]   380221 ms: Mark-sweep 1399.1 (1571.3) -> 1399.1 (1571.3) MB, 275.9 / 0.0 ms  allocation failure GC in old space requested
[5385:0x312b5e0]   380568 ms: Mark-sweep 1399.1 (1571.3) -> 1398.8 (1508.3) MB, 347.3 / 0.1 ms  last resort 
[5385:0x312b5e0]   380876 ms: Mark-sweep 1398.8 (1508.3) -> 1398.6 (1491.8) MB, 307.2 / 0.1 ms  last resort 


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x4c3d7f1ba79 <JS Object>
    1: DoJoin(aka DoJoin) [native array.js:~96] [pc=0x244b3dc53ccf](this=0x4c3d7f02241 <undefined>,p=0x1339e3e8a519 <JS Array[2]>,q=2,E=0x4c3d7f022c1 <true>,A=0x4c3d7f02859 <String[0]: >,z=0x4c3d7f022f1 <false>)
    2: Join(aka Join) [native array.js:~121] [pc=0x244b3dc4f928](this=0x4c3d7f02241 <undefined>,p=0x1339e3e8a519 <JS Array[2]>,q=2,A=0x4c3d7f02859 <String[0]: >,z=0x4c3d7f022f1 <false>)
...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [node]
 2: 0x13647ec [node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
 5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node]
 6: v8::internal::Runtime_StringBuilderConcat(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 7: 0x244b3c0840bd
Aborted (core dumped)
@KyleAMathews
Copy link
Contributor

Node.js by default only allows for ~1.4 GB of memory to be used. To use more, run Gatsby like the following node --max_old_space_size=4096 ./node_modules/.bin/gatsby setting 4096 to as much memory as you need/have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants