为什么我的 Silverlight 应用程序使用如此多的非托管内存?

发布于 2024-12-17 10:04:57 字数 567 浏览 0 评论 0原文

我有一个相当简单的 Silverlight 应用程序,最近我们收到用户的报告,该应用程序在使用几个小时(4+)后崩溃。我们开始深入研究该应用程序,并注意到该应用程序使用的非托管内存部分一开始非常高,并且继续不受控制地增长。其他堆似乎管理得很好。我做了很多研究,甚至从我的应用程序中删除了所有图像,并且非托管内存继续增长。

此时我只是很困惑到底是什么消耗了我的应用程序中的所有非托管内存以及我可以做些什么。这是我的应用程序在初始加载后的快照,您可以看到它已经使用了超过 100MB 的非托管内存空间。我只是在这里寻找有关哪些对象可以位于非托管内存中以及如何减少我的应用程序正在使用的非托管内存量的任何指导。谢谢!

Ants Memory Snapshot

我使用 .NET Memory Profiler 拍摄了另外一两个快照,看来 Kernel-HeapMemory 是最大的块。不确定这是否有很大帮助,但我想无论如何我都会发布它。

在此处输入图像描述

I have a rather simple Silverlight application, lately we've been having reports from users of the application crashing after several hours of use (4+). We started digging into the application and noticed that the un-managed portion of memory being used by the application starts very high and continues to grow unchecked. The other heaps seem to be managed just fine. I've done a lot of research and even went as far removing all images from my application and the un-managed memory continues to grow.

I'm just confused at this point as to what exactly is consuming all the un-managed memory in my application and what I can do about it. Here is a snapshot of my application after initial load, as you can see it's already using over 100MB of un-managed memory space. I'm just looking for any guidance here on what objects could be in un-managed memory and what to do to reduce the amount of un-managed memory my application is using. Thanks!

Ants Memory Snapshot

I've taken another snapshot or two using the .NET Memory Profiler and it appears that the Kernel-HeapMemory is the largest chunk. Not sure if this helps much but I thought I would post it anyway.

enter image description here

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

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

发布评论

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

评论(1

怀中猫帐中妖 2024-12-24 10:04:57

Have you tried the CLR Profiler for Silverlight? I've used it with some success in the past to troubleshoot memory issues.

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