Couchbase python SDK memory leaking for simple KV get operation

We have problem in our applications with memory consumption after upgrade to python client SDK version 3.2.*. Simple get operation in a while iteration is consuming more and more memory.

Example code:

from couchbase.cluster import Cluster, ClusterOptions
from couchbase.auth import PasswordAuthenticator
cluster = Cluster('couchbase://some-cluster?enable_tracing=false', ClusterOptions(PasswordAuthenticator('xxx', 'xxx')))

cb = cluster.bucket('xxx')
cb_coll_default = cb.default_collection()
cb_coll_default.upsert(str(123), '123')
for i in range(10000000):
  except Exception:

Have anyone the same experiences?

Hi @petr.zelenka , welcome to the forum!

As per the following forum article, can you confirm that you are running the latest Couchbase Python SDK:
With python sdk version [3.2.4], this problem is fixed.
Just upgrade sdk to version 3.2.4 with
python3 -m pip install --upgrade couchbase

The relevant Jira issue ticket is here:

And the fix commit here:

I hope that helps!

I have tried all versions from 3.0.0 up to 3.2.6 and I have the same issue. There is no problem in old 2.5 SDK version.

Hi @petr.zelenka

I have been able to reproduce the issue you have seen. You can follow the progress of the issue here

Hi @petr.zelenka - Just want to give an update that we released version 4.0.3 of the SDK yesterday which includes a fix for this issue.