Just add this below line to before line of you getting error in your file
It will take unlimited memory usage of server, it's working fine.
You still should check why the memory is exhausted. Maybe you don't need to read the whole file, maybe read it sequentially.
- @panidarapu and @Don Jones: Depending on the amount of memory, and how this script is used, it could be dangerous to allow the change in memory usage in this way. Don, in your case, you can likely break the feed down into smaller chunks and parse what you need. Glad it works, but be careful.
This suggestion worked for me. Dynamically increasing memory limit in the script is done via function ini_set(): ini_set('memory_limit', '128M');
Guys, please don't go for this quick fix. It can hurt you in long run. As a good programmer, you should figure-out the reason behind this memory consumption & increase as required instead of keeping it UNLIMITED.
Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).