You may run out of memory when compiling, upgrading or deploying Magento 2 code. Explicitly increasing PHP’s memory_limit may help.

Some examples:

Setting PHP memory_limit to -1 lets PHP use the maximum available memory. In many cases, you should now be able to run your Magento 2 commands.

Fixing memory limit errors during compilation or upgrade
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.
Tags: