Increase local memory for build?

We have built a rather large (24,000 unique pages) on MM.
When we go to build the site locally we are running into ‘out of memory’ errors.
Is there an option to increase the memory allocated to MM?
The set-up is Ubuntu 18.04 LTS (running on a Windows 10 PC)

For anybody running into the same issue, we did a couple of things that helped:

  1. We bumped up the memory on the Ubuntu instance. A t2.micro just doesn’t cut it when building a larger site.
  2. we included f.client_options = { max_include_resolution_depth: XX } in config.rb in our contentful integration which reduces the amount of looping that takes place in the event of circular references. Replace XX with your ‘include’ level plus one as explained here