Skip to main content

Comments

8 comments

  • Matthias Van Woensel

    The build container is currently limited to 2GB of memory, regardless of the plan you are on.

    This will be changed in the near future, but meanwhile, you can limit the amount of memory NPM uses by changing the NODE_OPTIONS via your .platform.app.yaml file.

    variables:
           env:
               NODE_OPTIONS: --max_old_space_size=1536
    
    0
  • Platform.sh DevRel

    Some useful keywords here: webpack, react, create-react-app, react-scripts build
    Error message: The build failed because the process exited too early. This probably means the system ran out of memory or someone called kill -9 on the process.

    0
  • Fabricio Nascimento

    @matthias-van-woensel Is the build container still limited to 2GB of memory?
    Because I’m facing the same issue, even limiting the amount of memory NPM uses for the above example.
    Are there another possible solutions to try to apply?

    0
  • Matthias Van Woensel

    It currently still is yes. We are working on an alternative. But that’s not ready yet.

    Could you try with yarn? Does that give better results?
    Reach out to the support team to get some additional help.

    0
  • Fabricio Nascimento

    Thanks @matthias-van-woensel for the quick answer, the support team helped me to solve it.

    0
  • Platform.sh DevRel

    Would you kindly share insight on how the support team fixed this issue? We have the same exact problem and various support reps have been trying to fix it, albeit unsuccessfully. Same exact results with yarn and npm.

    yarn run production
    yarn run v1.22.19
    $ NODE_ENV=production webpack
    Killed
    error Command failed with exit code 137.
    
    0
  • Matthias Van Woensel

    It means you are running out of memory on the build container. Have a look at the amount of memory your build is taking locally. If it is more than 2GB, it won’t currently work.

    Might be best to make a support ticket to get a support agent to look at your project specifics.

    0
  • Platform.sh DevRel

    Thank you for letting me know. Yes I do see webpack spikes to 1.98GB, and with the memory required by other concurrent node scripts and VSCode, I imagine it’s tipping the scales enough to cause the process to be killed on the server.

    I appreciate the help.

    0

Please sign in to leave a comment.