Memory issue with PHP SDK

I bumped into a memory issue while looping through thousands of larger objects and using the upsert method to insert / update the object in Couchbase.

While dumping the memory usage right before and after the upsert (PHP SDK ) there seems to be an increase in memory with every loop. It look to me that the contents of the JSON-document remains in the memory.

I can reproduce this issue with versions 2.0.0, 2.0.1 and 2.0.2. This issue is not limited to the upsert method.

Is the PHP SDK leaking memory?

Hey peteradkins,

The transformation of documents actually occurs in PHP, which is garbage collected. The JSON documents that are encoded are stored entirely as PHP objects, making it unlikely for the memory to be leaked. Do you have any further information available regarding the leak you are seeing?

Cheers, Brett

1 Like

Hi Brett,

I have sent you an email with an example. Thanks.

Reproducible to 2.0.5 and fixed in 2.0.6. For more information see commit and issue.