<legend id='kRmtG'><style id='kRmtG'><dir id='kRmtG'><q id='kRmtG'></q></dir></style></legend>

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

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

        <tfoot id='kRmtG'></tfoot>
          <bdo id='kRmtG'></bdo><ul id='kRmtG'></ul>

        核心 API 调用 System.gc()

        System.gc() calls by core APIs(核心 API 调用 System.gc())

                <tbody id='LtIzd'></tbody>

              <i id='LtIzd'><tr id='LtIzd'><dt id='LtIzd'><q id='LtIzd'><span id='LtIzd'><b id='LtIzd'><form id='LtIzd'><ins id='LtIzd'></ins><ul id='LtIzd'></ul><sub id='LtIzd'></sub></form><legend id='LtIzd'></legend><bdo id='LtIzd'><pre id='LtIzd'><center id='LtIzd'></center></pre></bdo></b><th id='LtIzd'></th></span></q></dt></tr></i><div id='LtIzd'><tfoot id='LtIzd'></tfoot><dl id='LtIzd'><fieldset id='LtIzd'></fieldset></dl></div>
              <legend id='LtIzd'><style id='LtIzd'><dir id='LtIzd'><q id='LtIzd'></q></dir></style></legend>
            • <small id='LtIzd'></small><noframes id='LtIzd'>

            • <tfoot id='LtIzd'></tfoot>
                <bdo id='LtIzd'></bdo><ul id='LtIzd'></ul>

                1. 本文介绍了核心 API 调用 System.gc()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  Some of you probably know that some of core java APIs make explicit calls to System.gc(). I know two cases when this happens:

                  1. NIO. I believe that is done to do some cleanup for direct ByteBuffers, when system runs out of "direct" memory.
                  2. RMI. Here, the reason is not that clear for me...

                  So, questions are:

                  1. Do know reason why System.gc() is required for RMI?
                  2. Do you know any other situations when core APIs (or even some other popular libraries) can make a direct call to System.gc()?

                  解决方案

                  RMI calls the System.gc() in case there are distributed objects which need to be cleaned up. You can make it perform GC less often or effectively turn it off.

                  You can avoid direct ByteBuffer needing a GC to clean them up on the Sun/Oracle JVM by calling

                  ByteBuffer bb = ByteBuffer.allocateDirect(SIZE);
                  ((DirectBuffer) bb).cleaner().clean();
                  

                  这篇关于核心 API 调用 System.gc()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Bytecode features not available in the Java language(Java 语言中不可用的字节码功能)
                  ClassCastException because of classloaders?(ClassCastException 因为类加载器?)
                  How can I add a Javaagent to a JVM without stopping the JVM?(如何在不停止 JVM 的情况下将 Javaagent 添加到 JVM?)
                  Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )(无法在 32 位 JVM 上加载 64 位 SWT 库(替换 SWT 文件))
                  Encourage the JVM to GC rather than grow the heap?(鼓励 JVM 进行 GC 而不是增加堆?)
                  Why a sawtooth shaped graph?(为什么是锯齿形图形?)
                  1. <legend id='kGzzF'><style id='kGzzF'><dir id='kGzzF'><q id='kGzzF'></q></dir></style></legend>
                        <tbody id='kGzzF'></tbody>

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

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

                          • <bdo id='kGzzF'></bdo><ul id='kGzzF'></ul>

                          • <tfoot id='kGzzF'></tfoot>