-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
Memory leak (?) in Python in version 3.15.0+ #9917
Comments
From 3.15.0 the install is using cpp extension by default. 3.14.0's default is pure python. We have reference leak tests for cpp extension. Not sure why the memory retains so much... Will do more checks |
When you say "by default", does this mean that you can switch 3.15.0+ to use pure Python when using the package? EDIT:
|
Yes, it can be switched to pure python by set the environment |
This issue should be fixed in 4.21.0-rc1. |
@haberman please clarify. Did you mean 3.21.0-rc1? I don't see a tag for either 4.21.0 or 3.21.0 but 3.21.0 seems more reasonable. What was the commit that fixed this? |
Our new release is 4.21.0-rc1: https://pypi.org/project/protobuf/4.21.0rc1/#files There was not a single commit that fixes this, it is fixed by the C extension rewrite being released in 4.21: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates The release announcement also mentions more about the version numbering: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#versioning |
What version of protobuf and what language are you using?
Version: 3.14.0/v3.15.0
Language: Python
What operating system (Linux, Windows, ...) and version?
Ubuntu Linux
What runtime / compiler are you using (e.g., python version or gcc version)
Python v3.9.5
Built protobuf schema with protoc 3.14.0
What did you do?
Steps to reproduce the behavior:
git clone https://github.com/Atheuz/proto_leak.git
.cd proto_leak
.virtualenv .venv --python=3.9
and activate it withsource .venv/bin/activate
.pip install -r requirements.txt
. (installs protobuf==3.14.0)python leak.py
pip install protobuf==3.15.0
python leak.py
What did you expect to see
In 3.15.0, I expected it to free basically all memory used for the list of pb items.
What did you see instead?
In 3.15.0, it retains 500+ MB of memory that is not retained in 3.14.0.
The text was updated successfully, but these errors were encountered: