You need to open php.ini file and need to change the memory size
sudo code /Applications/MAMP/bin/php/php[your_php_version]/conf/php.ini
OR
sudo nano /Applications/MAMP/bin/php/php[your_php_version]/conf/php.ini
search ‘memory_limit’ and increase the number:
memory_limit = 1028M