• <small id='piiD1'></small><noframes id='piiD1'>

      <legend id='piiD1'><style id='piiD1'><dir id='piiD1'><q id='piiD1'></q></dir></style></legend><tfoot id='piiD1'></tfoot>

        <bdo id='piiD1'></bdo><ul id='piiD1'></ul>

      1. <i id='piiD1'><tr id='piiD1'><dt id='piiD1'><q id='piiD1'><span id='piiD1'><b id='piiD1'><form id='piiD1'><ins id='piiD1'></ins><ul id='piiD1'></ul><sub id='piiD1'></sub></form><legend id='piiD1'></legend><bdo id='piiD1'><pre id='piiD1'><center id='piiD1'></center></pre></bdo></b><th id='piiD1'></th></span></q></dt></tr></i><div id='piiD1'><tfoot id='piiD1'></tfoot><dl id='piiD1'><fieldset id='piiD1'></fieldset></dl></div>

        确定正在运行的垃圾收集器

        时间:2023-09-13

          • <bdo id='Ium8a'></bdo><ul id='Ium8a'></ul>
              <tbody id='Ium8a'></tbody>

              <legend id='Ium8a'><style id='Ium8a'><dir id='Ium8a'><q id='Ium8a'></q></dir></style></legend>
              <tfoot id='Ium8a'></tfoot>

              <i id='Ium8a'><tr id='Ium8a'><dt id='Ium8a'><q id='Ium8a'><span id='Ium8a'><b id='Ium8a'><form id='Ium8a'><ins id='Ium8a'></ins><ul id='Ium8a'></ul><sub id='Ium8a'></sub></form><legend id='Ium8a'></legend><bdo id='Ium8a'><pre id='Ium8a'><center id='Ium8a'></center></pre></bdo></b><th id='Ium8a'></th></span></q></dt></tr></i><div id='Ium8a'><tfoot id='Ium8a'></tfoot><dl id='Ium8a'><fieldset id='Ium8a'></fieldset></dl></div>

                <small id='Ium8a'></small><noframes id='Ium8a'>

                1. 本文介绍了确定正在运行的垃圾收集器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 Windows Server 2003 x64(2x Xeon 4 核心 procs)上运行一个大型 .net 4.0 x86 应用程序,并且遇到问题,我的应用程序每天大约 2-3 次冻结 30 秒,然后恢复运行像平常一样.该应用程序每周仅重新启动一次,并消耗 400-800 mb 的内存,所以我假设这些冻结是垃圾收集.我只在日志中看到冻结,而不是实时,或者我会检查任务管理器来确认.

                  I am running a large .net 4.0 x86 app on Windows Server 2003 x64 (2x Xeon 4 core procs), and am running into issues where my app ~2-3 times a day freezes for 30 seconds, and then resumes functioning as normal. The application is only rebooted once a week, and consumes 400-800 mb of memory, so I am assuming these freezes are Garbage Collection. I am only seeing the freezes in the logs, not live, or I would check the Task Manager to confirm.

                  我试图弄清楚哪个 .Net 4 GC 正在运行,以及如何将 GC 切换到新的并发后台 gc(如果不是),或者如何确认这些实际上是 GC(Procmon 没有在 Win2k3 服务器中显示 .Net 工具).

                  I am trying to figure out which .Net 4 GC is running, and how to either switch the GC to the new concurrent background gc if it isn't, or how to confirm these are in fact GCs (Procmon doesn't show .Net instruments in Win2k3 server).

                  推荐答案

                  你运行的是服务器版的Windows,默认会得到服务器版的垃圾回收器.它不进行后台收集,垃圾由多个线程收集,因此偶尔可观察到的暂停并不罕见.您可以使用 app.exe.config 文件强制工作站版本:

                  You are running on the server version of Windows, you'll get the server version of the garbage collector by default. Which doesn't do background collections, garbage is collected by multiple threads so occasional observable pauses are not unusual. You can force the workstation version with an app.exe.config file:

                  <configuration>
                     <runtime>
                        <gcServer enabled="false"/>
                     </runtime>
                  </configuration>
                  

                  同时查看 GC.RegisterForFullGCNotification() 处理暂停副作用的方法.

                  Also review the docs for the GC.RegisterForFullGCNotification() method for a way to deal with the side-effect of the pauses.

                  .NET 4.5 版将支持服务器 GC 的后台收集.

                  .NET version 4.5 will support background collections for the server GC.

                  这篇关于确定正在运行的垃圾收集器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:值类型会收集垃圾吗? 下一篇:标准 C++ 中的垃圾收集是自动的吗?

                  相关文章

                  • <bdo id='6silm'></bdo><ul id='6silm'></ul>
                    <legend id='6silm'><style id='6silm'><dir id='6silm'><q id='6silm'></q></dir></style></legend>

                    1. <tfoot id='6silm'></tfoot>
                    2. <i id='6silm'><tr id='6silm'><dt id='6silm'><q id='6silm'><span id='6silm'><b id='6silm'><form id='6silm'><ins id='6silm'></ins><ul id='6silm'></ul><sub id='6silm'></sub></form><legend id='6silm'></legend><bdo id='6silm'><pre id='6silm'><center id='6silm'></center></pre></bdo></b><th id='6silm'></th></span></q></dt></tr></i><div id='6silm'><tfoot id='6silm'></tfoot><dl id='6silm'><fieldset id='6silm'></fieldset></dl></div>
                    3. <small id='6silm'></small><noframes id='6silm'>