When compiling Magento 2, I'm getting the error:
Fatal error: Out of memory (allocated 294125568) (tried to allocate 32 bytes) in /vendor/zendframework/zend-code/src/Scanner/FileScanner.php on line 36
I've read a ton of answers to this question, and everyone suggests using
-dmemory_limit to increase memory while compiling. I've tried 756M, 4G, 5G, 8G, 16G, etc and it still doesn't work.