Pydantic’s JSON loading uses a huge amount of memory; here’s how to reduce it.| Python⇒Speed
If you have a good test suite, you may be able use pytest fixtures to identify memory and other resource leaks.| Python⇒Speed