Curl Memory Overflow leaks

Source: Internet
Author: User

Leaks memory

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

Up vote2down vote

Stories from the internet indicate that's broken in for curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) 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-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, the PHP version.


Use Curl in PHP's ES third-party extension library for request requests Yes, the author discarded the original OPT output and enabled OB output

CURL opt returntransfer leaks memory, therefore OB instead.
Ob_start ();
curl_exec ($conn) ;
Ob_get_clean ();


Curl Memory Overflow leaks

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.