# Langsmith memory error

**URL:** <https://forum.langchain.com/t/langsmith-memory-error/1267>\
**Category:** Observability & Evals\
**Created:** [August 20, 2025, 7:03am UTC](https://forum.langchain.com/t/langsmith-memory-error/1267 "2025-08-20T07:03:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jing](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jing](https://forum.langchain.com/u/Jing)\
**Post date:** [August 20, 2025, 7:03am UTC](https://forum.langchain.com/t/langsmith-memory-error/1267/1 "2025-08-20T07:03:37Z")

</div>

Hi,

I’m tracing my agents with Langsmith, my agents deploy on GCP cloud run, and the cloud run keeps showing the following error:

Traceback (most recent call last): File “/opt/venv/lib/python3.11/site-packages/langsmith/\_internal/\_background\_thread.py”, line 113, in \_tracing\_thread\_drain\_compressed\_buffer client.compressed\_traces.compressor\_writer.flush() zstd.ZstdError: zstd compress error: Allocation error : not enough memory

Could you help with this issue?

Thanks

---

<div class="post-metadata">

**Author:** ![Jing](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jing](https://forum.langchain.com/u/Jing)\
**Post date:** [August 22, 2025, 7:20am UTC](https://forum.langchain.com/t/langsmith-memory-error/1267/2 "2025-08-22T07:20:28Z")

</div>

Hi,

any updates?

---

<div class="post-metadata">

**Author:** ![angus](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/angus/32/1428_2.png) [@angus](https://forum.langchain.com/u/angus)\
**Post date:** [August 22, 2025, 8:22am UTC](https://forum.langchain.com/t/langsmith-memory-error/1267/3 "2025-08-22T08:22:29Z")

</div>

How much memory are you provisioning in your GCP cloud run?

---

<div class="post-metadata">

**Author:** ![Jing](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jing](https://forum.langchain.com/u/Jing)\
**Post date:** [August 22, 2025, 9:13am UTC](https://forum.langchain.com/t/langsmith-memory-error/1267/4 "2025-08-22T09:13:40Z")

</div>

Thanks for the reply.

Memory is 16GB, and its utilization is 30+% when the issue is occurred.

After we restart the instance, we did not see the error.

The same happened again today.

 ![image](https://canada1.discourse-cdn.com/flex007/uploads/langchain/original/1X/95db35052b4c40405614e62836e2c6b48cf3be03.png)

---

<div class="post-metadata">

**Author:** ![angus](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/angus/32/1428_2.png) [@angus](https://forum.langchain.com/u/angus)\
**Post date:** [August 25, 2025, 7:51am UTC](https://forum.langchain.com/t/langsmith-memory-error/1267/5 "2025-08-25T07:51:09Z")

</div>

> [@Jing](#):
>
> Memory is 16GB, and its utilization is 30+% when the issue is occurred.
> 
> After we restart the instance, we did not see the error.

@jing I will look into this on my end, maybe something to do with how we handle compression threading. In the meantime, you can set this env var to disable compression  
`export LANGSMITH_DISABLE_RUN_COMPRESSION=true`

---

<div class="post-metadata">

**Author:** ![Jing](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jing](https://forum.langchain.com/u/Jing)\
**Post date:** [August 26, 2025, 1:42am UTC](https://forum.langchain.com/t/langsmith-memory-error/1267/6 "2025-08-26T01:42:10Z")

</div>

Thanks, I’ll try it.

---

<div class="post-metadata">

**Author:** ![angus](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/angus/32/1428_2.png) [@angus](https://forum.langchain.com/u/angus)\
**Post date:** [August 27, 2025, 9:25pm UTC](https://forum.langchain.com/t/langsmith-memory-error/1267/7 "2025-08-27T21:25:36Z")

</div>

Hi @Jing

I added the ability to disable multi-threaded compression in the LangSmith sdk as well as making some memory optimizations which should fix the issue you were seeing.

If you want to give compression another go (which will generally benefit memory utilization and trace ingest latency) I would try upgrading the latest langsmith version \*(\>= 0.4.19), re-enabling compression, and then setting the following: `LANGSMITH_RUN_COMPRESSION_THREADS=0`

---

<div class="post-metadata">

**Author:** ![Jing](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jing](https://forum.langchain.com/u/Jing)\
**Post date:** [August 28, 2025, 1:39am UTC](https://forum.langchain.com/t/langsmith-memory-error/1267/8 "2025-08-28T01:39:01Z")

</div>

Thank you so much for the quick response and clear solution!

I really appreciate your help. I’ll try out your method right away.
