rollbar-php icon indicating copy to clipboard operation
rollbar-php copied to clipboard

"Allowed memory size of ... bytes exhausted"

Open paulrrogers opened this issue 7 years ago • 5 comments

Apparently some of my exceptions have a deep trace or otherwise are overflowing memory. Any chance Rollbar's error unwinding could be made less memory intense?

1 File "/.../vendor/rollbar/rollbar/src/rollbar.php", line 184 in Rollbar\DataBuilder::generateErrorWrapper 2 File "/.../vendor/rollbar/rollbar/src/rollbar.php", line 161 in Rollbar\Rollbar::generateErrorWrapper 3 File "/.../vendor/rollbar/rollbar/src/DataBuilder.php", line 981 in Rollbar\Rollbar::fatalHandler

paulrrogers avatar Nov 03 '17 15:11 paulrrogers

@paulrrogers thanks for bringing this up. Can you explain more how your error reporting is too verbal? I would love to see so some examples of error reports that are just too memory intensive. Especially the ones that are causing the memory exhaustion.

ArturMoczulski avatar Nov 03 '17 21:11 ArturMoczulski

I'm closing this issue for now. @paulrrogers if you want us to investigate further we need your help diagnosing this

ArturMoczulski avatar Nov 17 '17 04:11 ArturMoczulski

Hello, I'm currently using Rollbar-php 1.4.1, and I have this error too. Here is what I get on rollbar.com from my production server:

E_ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 98570240 bytes): Allowed memory size of 134217728 bytes exhausted (tried to allocate 98570240 bytes) (Most recent call first)

File /composer/vendor/rollbar/rollbar/src/Payload/EncodedPayload.php line 37

I can help you to investigate further, what do you need to know ?

plaffitt avatar Apr 30 '19 08:04 plaffitt

We do have the same symptom. There's a complex flow in the Drupal application, without Rollbar, it works, with Rollbar, the memory limit is exceeded. Likely a notice or a warning is generated at some point and Rollbar doesn't have enough memory to prepare properly the payload that should be sent to the server. Checking what could be done about it.

AronNovak avatar Mar 18 '20 10:03 AronNovak

We had this problem as well. In our case it turned out that the stack traces contained UploadedFile objects which were tried to be encoded fully. Extending Rollbar\RollbarLogger and customizing getPayload to filter out / replace these objects with static strings did the trick in our case.

j6s avatar Jul 21 '20 07:07 j6s