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

Memory bloat with PDO instrumentation

Open asldevi opened this issue 5 years ago • 2 comments

we're observing a memory bloat with PDO's instrumentation handleStatementExecute method .

If I comment out the following line, which does the instumentation, memory bloat disappears.

opencensus_trace_method('PDOStatement', 'execute', [static::class, 'handleStatementExecute']);

Here's a profile info from blackfire for the same. Screenshot 2020-09-23 at 9 58 59 AM

asldevi avatar Sep 23 '20 04:09 asldevi

@asldevi are you still encountering this issue, or were you able to work around it?

MrMage avatar Jan 28 '21 14:01 MrMage

@MrMage We've realized that this is not a PDO specific problem, but rather the lib holding spans until the request-response cycle is completed. This is causing memory bloats for requests having large number of spans.

We're working on a solution to export every N spans as they come in, and release the memory, just like other Jaeger clients do. There are few intricacies, though. /cc @ShivamYuvraj

asldevi avatar Jan 29 '21 05:01 asldevi