This error is coming when you use large amount of data then php throw this fatal error such as – when you download large excel sheet or csv data dynamically.
Solution:
Simple go in php configuration file(php.ini) and increase your memory_limit and then restart your Apache server and try again.