You might notice these errors often if you are working with large size objects:-
Fatal error: Allowed memory size of 33554432 bytes exhausted
Fatal error: Allowed memory size of 134217728 bytes exhausted
You can try to increase the memory_limit by adding this statement in your php.ini file:-
However you can still get the above error messages because of the memory leaks, so better you call the destructor for the big objects you are creating.
$bigObj = new BigClass(); $bigObj->__destruct(); unset($bigObj);
This should fix your memory leak issues.