English 中文(简体)
有没有办法把线程的内存区封起来?
原标题:Any way to wall off a thread s memory area?
  • 时间:2011-05-27 03:23:49
  •  标签:
  • c#
  • .net

我有一个进程会泄露内存。我知道造成这种情况的原因,并有解决办法。这不是这个问题的意义所在。

在我的情况下,消除内存泄漏破坏性影响的一种方法是运行这个过程的许多实例,实际上是在单独的过程中,让每个实例都顺其自然,自然死亡。(每个只泄漏几兆欧)

然而,这似乎涉及到大量的开销。

有没有办法在.NET中创建内存墙?(而不是产生一个过程)-这样墙内的一切都可以随意拆除。

当然,有人为的答案涉及某种元记忆系统;不是我真正想要的,除非它非常聪明:)

请不要评论我应该如何修复内存泄漏。(它在.NET框架中)

最佳回答

查看应用程序域,不过我也恳请您解决问题的根本原因。

问题回答

治疗病因,而不是症状

你能证明框架中存在漏洞吗(你是否提交了Connect问题)?这更有可能是代码中的内存泄漏。

下载memprofiler红门蚂蚁dotTrace(所有版本都有试用版),并查找并修复实际问题。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签