TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Rust: Investigating an Out of Memory Error

111 点作者 erebe__4 个月前

8 条评论

CodesInChaos4 个月前
The analysis looks rather half-finished. They did not analyze why so much memory was consumed. If this is the cache which persists after the first call, if it&#x27;s temporary working memory, or if it&#x27;s an accumulating memory leak. And why it uses so much memory at all.<p>I couldn&#x27;t find any other complaints about rust backtrace printing consuming a lot of memory, which I would have expected if this was normal behaviour. So I wonder if there is anything special about their environment or usecase?<p>I would assume that the same OOM problem would arise when printing a panic backtrace. Either their instance has enough memory to print backtraces, or it doesn&#x27;t. So I don&#x27;t understand why they only disable lib backtraces.
评论 #42756148 未加载
xgb84j4 个月前
In the article they talk about how printing an error from the anyhow crate in debug format creates a full backtrace, which leads to an OOM error. This happens even with 4 GB of memory.<p>Why does creating a backtrace need such a large amount of memory? Is there a memory leak involved as well?
评论 #42755967 未加载
评论 #42755335 未加载
评论 #42756072 未加载
评论 #42755330 未加载
malkia4 个月前
Can&#x27;t they print something that llvm-symbolizer would pick up offline?
评论 #42758703 未加载
BimJeam4 个月前
I once had a faulty python based ai image generator running on my machine that used all 64 gigs of ram and oomed with a memory dump written to fs. This is no fun when that happens. But mostly these kind of bugs are misconfigurations or bad code, never ending while loops, whatever.
submeta4 个月前
Ahh, I did this in Python before I learned about Cursor and Sourceforge‘s Cody. I‘d use a template where I provide a tree of my project structure, and then put code file contents in my template file, and then have a full repo in one giant markdown file. This only worked for smaller projects, but it worked damn well to provide the full context to an LLM to then ask questions about my code :)
评论 #42760221 未加载
loeg4 个月前
It&#x27;s kind of shocking that debug-formatting a backtrace allocates enough memory to OOM the process, though. What&#x27;s going on there?
tasn4 个月前
Reminds me a bit of a post my colleague wrote a while back: <a href="https:&#x2F;&#x2F;www.svix.com&#x2F;blog&#x2F;heap-fragmentation-in-rust-applications&#x2F;">https:&#x2F;&#x2F;www.svix.com&#x2F;blog&#x2F;heap-fragmentation-in-rust-applica...</a>
评论 #42763905 未加载
评论 #42759793 未加载
samanthasu4 个月前
great one! and i would recommnd this hands-on guide for diagnosing memory leaks in Rust applications. it explains how to enable heap profiling in &#x27;jemalloc&#x27;, collect memory allocation data, and generate flame graphs for analysis. <a href="https:&#x2F;&#x2F;greptime.com&#x2F;blogs&#x2F;2024-01-18-memory-leak#diagnosing-memory-leaks-with-flame-graphs-and-jemalloc" rel="nofollow">https:&#x2F;&#x2F;greptime.com&#x2F;blogs&#x2F;2024-01-18-memory-leak#diagnosing...</a>