PHP memory_limit 有关问题解决

WBOY
Release: 2016-06-13 13:03:35
Original
912 people have browsed it

PHP memory_limit 问题解决

???? memory_limit虽然可以调节内存大小,但是如果一个php脚本里有比较大的DB结果集或者数组、对象等,或者有众多的结果集,如果这些占用资源的对象得不到及时释放,可能在脚本后面一截执行过程中出现 Allowed memory size of? xxx bytes exhausted at?xxx:xxx (tried to allocate xxx bytes)<span style="font-size: small;">的问题,所以这种情况下还是要及时的进行内存释放unset($xx),特别是一些CLI的PHP程序。</span>

?

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

?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template