cURL的内存溢出leaksmemory-创新互联

leaks memory

成都创新互联服务紧随时代发展步伐,进行技术革新和技术进步,经过十多年的发展和积累,已经汇集了一批资深网站策划师、设计师、专业的网站实施团队以及高素质售后服务人员,并且完全形成了一套成熟的业务流程,能够完全依照客户要求对网站进行网站建设、成都做网站、建设、维护、更新和改版,实现客户网站对外宣传展示的首要目的,并为客户企业品牌互联网化提供全面的解决方案。

http://stackoverflow.com/questions/26690026/php-curl-loop-leaking-memory

up vote2down vote

Stories from the internet indicate that curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) is broken in for some PHP/cURL versions:

  • #13225 Memmory leak in curl

  • #40831 cURL extension doesnt clear buffer for reused handle

  • PHP script memory leak issue

  • PHP cURL, memory leak when using CURLOPT_RETURNTRANSFER

You can also find stories for DOM:

  • DOMDocument PHP Memory Leak

  • PHP/DOMDocument: unset() does not release resources

  • DOMDocument / Xpath leaking memory during long command line process - any way to deconstruct this class

Create a minimal test case which spots the cause of the leak. I.e. remove the unrelated package (DOM or cURL) from the code.

Then reproduce it with the latest PHP version. If it's still causing the leak, file a bug report else use that PHP version.

在php的es第三方扩展库中使用cURL进行request请求是,作者舍弃了原有的opt输出,启用OB输出

// cURL opt returntransfer leaks memory, therefore OB instead.
ob_start();
curl_exec($conn);
$responseString = ob_get_clean();

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


文章名称:cURL的内存溢出leaksmemory-创新互联
网站链接:http://csruizhi.cn/article/iphpd.html

其他资讯

Copyright © 2007-2024 成都优众联杰科技有限公司 All Rights Reserved 蜀ICP备2024116266号
友情链接: 成都企业网站建设公司 成都网站建设公司 四川成都网站制作 网站制作公司 企业网站设计 品牌网站建设 成都网站建设推广 网站建设改版 营销型网站建设 成都网站建设 成都响应式网站建设公司 成都网站建设 定制网站建设多少钱 成都定制网站建设 重庆外贸网站建设 成都网站制作 达州网站设计 网站建设费用 移动手机网站制作 成都网站建设 成都网站设计 四川成都网站设计