Skip to content
This repository was archived by the owner on Oct 28, 2020. It is now read-only.
This repository was archived by the owner on Oct 28, 2020. It is now read-only.

Memory leak #5

Description

@dinamic

I have been investigating why our system workers are dying after a given amount of jobs are processed.

I was able to track the memory leak to this bundle.
Using the guzzle library itself does fix the issue, so it is definitely in the bundle itself.

I have even tried the case with more than 10,000 objects created, as this seem to be the limit after which the garbage collector becomes active, but the issue persists. Reference: https://bugs.php.net/bug.php?id=68132

My use case is as follows:

class SomeClass()
{
    public function someMethod()
    {
        /* @var $response Guzzle\Service\Command\CommandInterface */
        $command = $this->client->getCommand('get_item_by_id', $params);

        /* @var $response Guzzle\Http\Message\Response */
        $response = $command->getResponse();

        return $this->transformResponse($response->getBody(true));
    }

    protected function transformResponce($response)
    {
        /** some code that transforms json to an object */
    }

Replacing some parts of the code by avoiding the bundle seems to fix the case for me:

    $client = new \Guzzle\Http\Client('https://baseurl.com/api');
    $request = $client->get('url.php?id=' . $id);
    $response = $request->send();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions