Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pubsub: memory leak #4978

Closed
jeanbza opened this issue Feb 28, 2018 · 5 comments
Closed

pubsub: memory leak #4978

jeanbza opened this issue Feb 28, 2018 · 5 comments
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. release blocking Required feature/issue must be fixed prior to next release. triaged for GA

Comments

@jeanbza
Copy link
Contributor

jeanbza commented Feb 28, 2018

  1. Specify the API at the beginning of the title (for example, "BigQuery: ...")

Pubsub

  1. OS type and version

alpine 3.6

  1. Python version and virtual environment information python --version

3.6.1

  1. google-cloud-python version pip show google-cloud, pip show google-<service> or pip freeze
google-api-core (0.1.4)
google-auth (1.4.1)
google-cloud-pubsub (0.31.0)
googleapis-common-protos (1.5.3)
grpc-google-iam-v1 (0.11.4)
  1. Stacktrace if available
  2. Steps to reproduce

Stick code provided below on a k8s pod, spam pubsub with messages, watch memory eventually top out at 2.5G and crash the pod.

  1. Code example

https://gist.github.com/jadekler/99524a3a8425c45e9299948032dd4e71

screen shot 2018-02-28 at 2 13 00 pm

(pink is python, green is go - python crashes the pod at 2.5gb, go continues at around 30mb as expected)

@theacodes theacodes added api: pubsub Issues related to the Pub/Sub API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. triaged for GA release blocking Required feature/issue must be fixed prior to next release. labels Feb 28, 2018
@theacodes
Copy link
Contributor

@jadekler your sample keeps a dictionary of seen messages - it expect this is at least contributing to memory growth. Can you remove it or use a bloom filter instead?

@jeanbza
Copy link
Contributor Author

jeanbza commented Feb 28, 2018

I bet you're right! I shall do so, sorry for the dummy mistake :)

@jeanbza
Copy link
Contributor Author

jeanbza commented Feb 28, 2018

Ill remove it entirely in fact; it's testing something out of scope for this issue.

@theacodes
Copy link
Contributor

It's fine, I don't think it's the sole cause but definitely will contribute to it.

@jeanbza
Copy link
Contributor Author

jeanbza commented Mar 2, 2018

Happy to report that using grpcio (1.10.0rc2), I'm not seeing any memory leaks.

Full list of deps:

google-api-core (0.1.4)
google-auth (1.4.1)
google-cloud-pubsub (0.32.0)
googleapis-common-protos (1.5.3)
grpc-google-iam-v1 (0.11.4)
grpcio (1.10.0rc2)

screen shot 2018-03-02 at 7 34 49 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. release blocking Required feature/issue must be fixed prior to next release. triaged for GA
Projects
None yet
Development

No branches or pull requests

2 participants