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 usage increases significantly going from pydantic 1.9.0 to 1.9.1 #4160
Comments
Is this related to #3641? How does the memory profile compare with v1.8.2? Can you provide a self contained, minimal example? |
Doesn't look like its related
v1.8.2 is similar to v1.9.0, peak memory usage was 3GB.
Will try to generate one later. |
opposite problem, but might be worth looking at #3829 too. |
I've have added a minimal reproducible example, |
@samuelcolvin, is this issue on some kind of roadmap? Cheers |
Well without a clear culprit and even proposed solution, there's not much we can do for v1.10. The entire design has changed completely for V2 so I would hope this is solved, but would love to see some memory profiling of pydantic-core if someone is willing to investigate? |
We’re no longer actively developing Pydantic V1 (although it will continue to receive security fixes for the next year or so), so we’re closing issues solely related to V1. If you really think this shouldn’t be closed, please comment or create a new issue 🚀. |
Checks
Bug
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:Updating between pydantic 1.9.0 and 1.9.1 results in a dramatic spike in memory usage for our production application. This is most prominent where we have deep nested BaseModel classes serialising large amounts of data to json.
The memory profiler indicates that Pydantic 1.9.1 is deep copying dictionary data, which it was not doing before
Attempted MRE:
There is a ~40% increase in mem usage for this example
The text was updated successfully, but these errors were encountered: