Proper way to prevent memory overflow, knowing the allowed memory size, but being unable to change it
<p>After searching stackoverflow for an answer, I decided that the only problems that were treated was those regarding the extension of the maximum allowed memory. My question is if anyone knows how to insert a proper brake in case the scripts might fail due to the exhausting the memory. </p>

<p>This as for point A, also this in very close relation to another problem for which I failed to find an answer, meaning point B, and that is the time limit: another set of answers on how to extend the time limit using ini_set, and so on, possible solution were found by manually create break points in case the script already over-exceeded a proper time. And that was very fine, but having no control over a script you are loading might be impossible to prevent it. </p>

<p>Now, back to the question, does anyone know how to properly prevent such errors with a safe method? And if there really was an answered question regarding this subject, please link me to it.</p>

<p>Best regards,</p>
