Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpClient] memory leak #46256

Closed
Closed
@Gounlaf

Description

@Gounlaf

Symfony version(s) affected

6.0.8

Description

Hi,

I'm hunting a memory leak since few days and finally found where it might be.
Context: I've a loop that do some work. Some metrics are collected, and pushed via a http request to a prometheus pushgateway.

When the Psr18Client is handling the response body, the leak happens.

How to reproduce

Here you can find a MRE: https://github.com/Gounlaf/sf-http-client-memory-leak

It rely on docker & docker-compose; up the service debug and then check your processes. You will find that memory of php process is increasing with $psr18Client = new Psr18Client(new \Symfony\Component\HttpClient\NativeHttpClient());
or $psr18Client = new Psr18Client(new \Symfony\Component\HttpClient\CurlHttpClient());
It doesn't with another (not symfony) implementation $psr18Client = new \Http\Client\Curl\Client($psr17factory, $psr17factory);

If this MRE is not enough, please let me know.

Regards.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions