Troubleshooting the error "Allowed memory size of X bytes exhausted"