mollie / mollie-api-php

Mollie API client for PHP
http://www.mollie.com
BSD 2-Clause "Simplified" License
552 stars 191 forks source link

Allowed memory size exhausted #490

Closed spee closed 4 years ago

spee commented 4 years ago

Specifications

As soon as I try to fetch an order, I hit this memory error:

<b>Fatal error</b>: Allowed memory size of 134217728 bytes exhausted (tried to allocate 125833216 bytes) in [...]

Describe the issue

In my webhook, I instantiate a Mollie client and try to fetch an order:

$mollie = new \Mollie\Api\MollieApiClient();
$mollie->setApiKey($this->apiKey());
$mollie->orders->get('123', array('testmode' => true));

If I increase the allowed memory size (default at 128M), even up to 3G, I always hit this error; it seems like a leak that just fills up infinite memory. Any tips how to debug this? Should I try an older version of the PHP API?

sandervanhooft commented 4 years ago

That's unfortunate. Can't reproduce it here.

Some ideas to try:

  1. replace the $this->apiKey() call with a hardcoded test key
  2. updating dependencies (perhaps the leak is caused by Guzzle)
  3. uninstall the mollie client and see if the memory issue persists.
spee commented 4 years ago

Sorry, I found the problem lies elsewhere in the code. I'm able to get the order just fine.

sandervanhooft commented 4 years ago

Thanks for following up, glad you fixed it. Enjoy! 🚀