Solution to PHPmemory_limit problems

Source: Internet
Author: User
PHPmemory_limit ???? Although memory_limit can adjust the memory size, if a php script contains a large DB result set, an array, an object, or many result sets, if the objects that occupy resources are not released in time, the PHP memory_limit problem may occur during the execution of the script.

???? Although memory_limit can adjust the memory size, if a php script contains a large DB result set, an array, an object, or many result sets, if these resource-consuming objects are not released in time, they may appear in the execution process after the script.Allowed memory size? Xxx bytes exhausted? Xxx: xxx (tried to allocate xxx bytes) problem, so in this case, we still need to release the memory unset ($ xx) in time, especially some cli php programs.

?

PHP vesion> = V5.2

Memory_get_usage (): http://php.chinaunix.net/manual/en/function.memory-get-usage.php

Memory_get_peak_usage (): http://php.chinaunix.net/manual/en/function.memory-get-peak-usage.php

?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.