-
Notifications
You must be signed in to change notification settings - Fork 11.3k
使用HTTP 客户端内存不释放 #55195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
为了将来参考,请用英语发布您的问题 Memory is not released when using HTTP clientLaravel Version11.44.2 PHP Version8.2 Database Driver & VersionNo response DescriptionWhen using the Http client to send requests in a loop, the memory keeps growing. Steps To Reproduce$uri = 'https://jsonplaceholder.typicode.com/posts';
do {
$this->info('Memory: ' . memory_get_usage());
//(new \GuzzleHttp\Client())->get($uri); // Memory does not grow
\Illuminate\Support\Facades\Http::get($uri); // Memory does grow
sleep(1);
} while (true); |
For reference, it is actually the other way around.
reference: https://www.php.net/manual/en/function.memory-get-usage.php But the bottom line is still the same as @timacdonald described. |
Interesting ! But why does the Guzzle way is not acting the same in the base example ? It don't look like there is some garbage collector usage difference but the memory is not increasing. |
Laravel Version
11.44.2
PHP Version
8.2
Database Driver & Version
No response
Description
在循环里面使用Http客户端发送请求,内存一直在增长
使用GuzzleHttp并不会
Steps To Reproduce
The text was updated successfully, but these errors were encountered: