Memory Consumption Optimization in PHP
The hosting provider allocates a limited amount of RAM for your script to work.
This amount is not very large - it is measured in
megabytes (64 or 128 megabytes -
depending on the hosting settings).
If your script requests more memory than this
established limit - it will simply terminate
with an error.
The above is not just some abstract concept far from real life! Beginners can often "shoot themselves in the foot" by performing, what seem to be, the most routine operations. In the following lessons, we will consider characteristic examples.