FG
🤖 AI & LLMsAnthropic

Memory leak while using anthropic python sdk 0.3.10

Freshover 2 years ago
Mar 14, 20260 views
Confidence Score87%
87%

Problem

We have a server implemented with FastAPI to cal Anthropic through Python, but when run the following experiments, the memory kept increasing and not released after stop sending request to the server. - a client sending http requests continuously to the server - concurrency 20 - running duration 2mins Sample server code logic [code block] When I replaced the Anthropic python sdk with httpx request directly, the memory kept low and stable during the same experiment. Same issue when using 0.3.11 as well. Would be great if you can help to take a look.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
84% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: Memory leak while using anthropic python sdk 0.3.10

Low Risk

> Thanks for the explanation @yuliu-eric . Unfortunately, I don't think there's much we can do to help here without a reproducible script. Can you try to compose one that demonstrates the issue? I will test tonight and let you know the reult .

84

Trust Score

3 verifications

100% success
  1. 1

    > Thanks for the explanation @yuliu-eric . Unfortunately, I don't think there's

    > Thanks for the explanation @yuliu-eric . Unfortunately, I don't think there's much we can do to help here without a reproducible script. Can you try to compose one that demonstrates the issue?

  2. 2

    I will test tonight and let you know the reult .

    I will test tonight and let you know the reult .

Validation

Resolved in anthropics/anthropic-sdk-python GitHub issue #150. Community reactions: 2 upvotes.

Verification Summary

Worked: 3
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

claudeanthropicllmapi