Once the development of a custom component has been completed, it is recommended to perform the stress test using real-life amount of test data. This will make the whole web project more robust and prevent performance deterioration.

To optimize memory consumption by a component, use the PHP functions "memory_get_usage" and "memory_get_peak_usage". The crucial point is to determine the maximum memory your component may allocate. If the component happens to allocate all of the memory available to the website, the client page request will inevitably fail.

The following coding and algorithmic errors are the most frequent reasons for excessive memory consumption.

Unfortunately, it is customary for developers to ignore these issues: they just increase the maximum memory limit to 512 MB or even more, which undermines the website robustness and decreases performance. The best practice is just the opposite: decrease the memory limit to 64 MB (according to Bitrix Framework requirements) and do your best to make your code work.

  1. Ensure these recommendations have been put into practice when developing custom components for the website.
  2. Look through the PHP error log with the website's administrator - once after performing the stress test and then on a weekly basis until you find and eliminate all errors.