Hiya @boringmoney ,
A couple of good resources:
-
[Support Guide] Making sure your builds use appropriate resources for Netlify's build system is probably the best one, describing what’s available and laying out some options for your local analysis.
-
GitHub - netlify/build-image: This is the build image used for running automated builds explains how to fire up our exact build image within docker, on your local machine. Then you could profile the memory use using whatever tools you like (since you use gatsby, something like this may be of service: Guide: How To Inspect Memory Usage in Node.js - or perhaps you just run the OS tools to see “how much memory docker is using at every second” so you can try to correlate the bigger part of your build to that usage.
Note from the above article, as a Business level customer, you have 11GiB/6Cpu to work with in your builds.