In PHP I usually work a lot with frameworks. Generally, they even bring query results to a database in array
.
In some cases, when the number of data in a table or a relationship reaches a very large level, if we do not use features like paging or an ajax lazy load, that error can happen.
Fatal error: Allowed memory size of 99999999 bytes exhausted
I've heard of cases where too much of an array has generated this error, but this can vary from one configuration of php.ini ( memory_limit
) to another. However, there is usually always a default value for the memory limit - which in this case is 128M for versions equal to or higher than PHP 5.3.
Considering the 128M
default, would it be possible to arrive at a calculation, to know more or less, how much data we could use in a array
?
Is there a recommended maximum size for me to allocate values in a array
?