Skip to content

Python: possible memory leak? #22123

@hackedd

Description

@hackedd

What version of gRPC and what language are you using?

gRPC 1.27.2, Python

What operating system (Linux, Windows,...) and version?

  • macOS 10.15.3
  • python:3.8 Docker image (Debian buster)

What runtime / compiler are you using (e.g. python version or version of gcc)

Python 3.8.1

What did you do?

We are running a gRPC API in Kubernetes and noticed the memory usage of the pods increases almost linearly with time. After ruling out a bunch of other stuff, it looks like there might be a memory leak in the grpcio library.

Locally I can reproduce the issue with the code from examples/python/helloworld and a script that watches the RSS of the server (https://gist.github.com/hackedd/b3a79fc49a76a9fa96945e1118da8190).

I've tried different versions of Python (3.6, 3.7) and of grpcio (1.26.0, 1.27.1, 1.27.2).

What did you expect to see?

Stable memory usage over time.

What did you see instead?

Increasing memory usage over time.

Anything else we should know about your project / environment?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions