线程堆栈是否报告为任务管理器中使用的内存?

发布于 2024-08-01 13:46:58 字数 295 浏览 1 评论 0原文

我和我的同事正在尝试跟踪应用程序中的内存问题,在我的研究中,我发现了 博客条目,讨论每个线程如何默认获取 1MB 堆栈。 我们的应用程序碰巧创建了很多线程,因此我们编写了一个快速测试程序以确保我们准确理解发生了什么。 测试应用程序 (C#) 刚刚创建了 300 个线程,但任务管理器仍然只显示 22MB 内存。 任务管理器未计算堆栈内存,还是发生了其他情况?

My coworkers and I are trying to track a memory issue in an application, and in my research I found a blog entry that talks about how each thread gets a 1MB stack by default. Our application happens to create a lot of threads, and so we wrote a quick test program to make sure we understood exactly what was happening. The test app (C#) just goes and creates 300 threads, but Task Manager still only showed 22MB of memory. Is stack memory not counted by Task Manager, or is something else going on?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

勿忘初心 2024-08-08 13:46:58

任务管理器不是确定内存消耗的最佳工具。 相反,下载免费试用版的工具,如 MemProfilerRedGate 的内存分析器

不要使用任务管理器中的内存使用情况列进行诊断或分析。 使用 Perfmon 计数器,特别是专用字节和特定的 .NET 计数器,它们将揭示内存泄漏等问题。

可能还感兴趣:.NET 应用程序的内存使用情况审核

Task Manager is not the best tool for memory consumtion determination. Instead, download the free trial of a tool like MemProfiler, or RedGate's Memory Profiler

Don’t use the mem usage column in Task Manager for diagnostics or profiling. Use the Perfmon counters, especially Private Bytes and the specific .NET counters that will reveal problems like memory leaks.

Might also be of interest: Memory Usage Auditing For .NET Applications

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文