English 中文(简体)
C#的翻新记忆管理
原标题:Per-thread memory management in C#
最佳回答

I searched for two days trying to find an answer to the same issue you had. The answer is you need to set the garbage collection mode to Server mode. By default, garbage collection mode set to Workstation mode. Setting garbage collection to Server mode causes the managed heap to split into separately managed sections, one-per CPU. To do this, you need to add a config setting to your app.config file.

<runtime>
   <gcServer enabled="true"/>
</runtime>

我12分6172英亩的速率差异非常大!

问题回答

垃圾收集器没有分配记忆。

更像你再分配一些小的临时物品和一些长期物体,而垃圾收集器则花费大量时间收集临时物品,因此,你的照片不必要求从监督厅得到更多的记忆。 http://msdn.microsoft.com/en-us/library/0xy59wtx.aspx”rel=“nofollow noreferer” NET Framework 4 Superior Development - Garbage Collection:

只要在管理下坡道上有空间,则运行时间继续为新物体分配空间。 然而,记忆并不明确。 最后,垃圾收集器必须进行收集,以便腾出一些记忆。

解决办法: 专用小型临时物体: Garbage Collection and Performance网页也是有益的。

您可以预先分配一组物体,并将它们保留在打算单独穿透的人群中。 然而,这很可能使你获得更好的业绩。

垃圾收集器是专门设计的,目的是高效处理小型短寿命物体。 如果你把物体放在一起,这些物体就会长寿,并将靠垃圾收集生存,而这反过来又意味着它们将被复制到第二代的肥皂中。 这一复制比仅仅分配新物体要贵。





相关问题
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. ...

热门标签