by athoscouto
3 subcomments
- We've been impacted by this. I migrated our services to Python 3.14 so we could attach profilers during runtime.
A couple of services looked like they had a memory leak. Memory was continuously increasing over time. Thanks to Python 3.14, we were able to use memray to understand what was going on. Those services were recreating HTTP clients (aiohttp) for every inbound request, and memory allocated by the downstream SSL lib was growing faster than it was being released.
We ended up rolling back to 3.13, which fixed the issue. I'll try again with 3.14.5.
by davidkwast
2 subcomments
- "Python 3.14 shipped with a new incremental garbage collector. However, we’ve had a number of reports of significant memory pressure in production environments.
We’ve decided to revert it in both 3.14 and 3.15, and go back to the generational GC from 3.13."
Sounds the right move for me
by NooneAtAll3
5 subcomments
- I'm genuinely surprised that python change was even possible without PEP
- .NET seems to have regularly changed the garbage collector over the years and I do not remember any similar surprises in production. I wonder why they have had better experience?
I thought that by now dynamic garbage collection was a known quantity so that making changes, outside of out right bugs, is fairly safe and predictable?
- I think reverting is not problem per se, but releasing a highly problematic version without proper testing in such an essential component is.
- The problem is that you create an HTTP client for each incoming request. In other words, you recreate SSL context and cause reference cycles with each request. From the memory point of view, the program seems to have a memory leak. However, the solution to the issue lies at the application level: just create your client once and reuse it for each subsequent request.
One of heuristics to find memory leaks can be stated as follows: if you instantiate any HTTP or connection objects inside the request handler, it's likely that you've made a mistake.
- If I understand correctly, this is one of the changes that caused the regression:
https://github.com/python/cpython/pull/117120
- This is the first time I came across a change (a big one) that was implemented without passing through PEP. I thought it was standard.
by emmanuelsemugga
0 subcomment
- This is so salient to put under consideration deeply
by nodesocket
0 subcomment
- If using containers I believe this change was pushed in image python:3.14.5-slim-trixie
- [flagged]
by lukassbrad
0 subcomment
- [flagged]
- [flagged]
- Python is such a mess.
- All these issues were known in previous attempts for removing the GIL. But if Instagram/Meta want it, everyone stands to attention and finds out the obvious problems years later. Kind of like in geopolitics.
I hope Meta switches Instagram to PHP/Hack so they leave Python alone.
by brianwawok
4 subcomments
- In the world of AI written code, Python just doesn’t make sense. Converted about 100k lines in the last few months to golang and the performance is life changing. Curious if we will see global Python adoption fall by 75% or more in the next few years.