|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-05-16 01:26 UTC] vagiz at kaifas dot lt
Description:
------------
system memory keeps growing when php infinity loop is used with curl inside
Test script:
---------------
<?php
while (1) {
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 40);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20180101 Firefox/60.1');
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl_handle, CURLOPT_URL, 'http://example.com');
$test = curl_exec($curl_handle);
curl_close($curl_handle);
unset($test, $curl_handle);
}
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
Re-tested versions: PHP 8.0.1 (cli) (built: Jan 5 2021 13:54:54) ( NTS gcc x86_64 ) Copyright (c) The PHP Group Zend Engine v4.0.1, Copyright (c) Zend Technologies with Zend OPcache v8.0.1, Copyright (c), by Zend Technologies PHP 7.4.14 (cli) (built: Jan 5 2021 10:45:06) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.14, Copyright (c), by Zend Technologies PHP 7.3.26 (cli) (built: Jan 5 2021 10:36:07) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.26, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.26, Copyright (c) 1999-2018, by Zend Technologies on CentOS 8; I can confirm - no memory leak after running the same script for 30mins+. Let me know if any help needed, otherwise I think we can close this ticket. Good job PHP team!