<bdo id='KyZB2'></bdo><ul id='KyZB2'></ul>
  1. <small id='KyZB2'></small><noframes id='KyZB2'>

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

      <legend id='KyZB2'><style id='KyZB2'><dir id='KyZB2'><q id='KyZB2'></q></dir></style></legend>
    1. Young , Tenured 和 Perm 一代

      时间:2023-07-12
        <tbody id='pmarM'></tbody>
        <i id='pmarM'><tr id='pmarM'><dt id='pmarM'><q id='pmarM'><span id='pmarM'><b id='pmarM'><form id='pmarM'><ins id='pmarM'></ins><ul id='pmarM'></ul><sub id='pmarM'></sub></form><legend id='pmarM'></legend><bdo id='pmarM'><pre id='pmarM'><center id='pmarM'></center></pre></bdo></b><th id='pmarM'></th></span></q></dt></tr></i><div id='pmarM'><tfoot id='pmarM'></tfoot><dl id='pmarM'><fieldset id='pmarM'></fieldset></dl></div>

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

        1. <tfoot id='pmarM'></tfoot>
          • <bdo id='pmarM'></bdo><ul id='pmarM'></ul>

            1. <legend id='pmarM'><style id='pmarM'><dir id='pmarM'><q id='pmarM'></q></dir></style></legend>

              • 本文介绍了Young , Tenured 和 Perm 一代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我对 Heap、Young、Tenured 和 Perm 一代感到困惑.

                I'm confused with Heap,Young,Tenured and Perm generation.

                谁能解释一下?

                推荐答案

                Java 垃圾收集器被称为Generational Garbage Collector.应用程序中的对象存在不同的时间长度,具体取决于它们的创建位置和使用方式.这里的关键见解是,对短期和长期对象使用不同的垃圾收集策略可以针对每种情况专门优化 GC.

                The Java garbage collector is referred to as a Generational Garbage Collector. Objects in an application live for varying lengths of time depending on where they are created and how they are used. The key insight here is that using different garbage collection strategies for short lived and long lived objects allows the GC to be optimised specifically for each case.

                粗略地说,随着对象在年轻一代中存活"重复的垃圾回收,它们被迁移到老一代.永久生成是一种特殊情况,它包含 JVM 所需的对象,但不一定在程序中表示,例如表示类和方法的对象.

                Loosely speaking, as objects "survive" repeated garbage collections in the Young Generation they are migrated to the Tenured Generation. The Permanent Generation is a special case, it contains objects, that are needed by the JVM, that are not necessarily represented in your program, for example objects that represent classes and methods.

                由于年轻一代中通常会包含大量垃圾,因此针对一次摆脱大量未使用的对象进行了优化.Tenured Generation 因为它包含寿命更长的对象,所以针对快速垃圾收集进行了优化,而不会浪费大量内存.

                Since the Young Generation will usually contain a lot of garbage in it, it is optimised for getting rid of a lot of unused objects at once. The Tenured Generation since it contains longer lived objects is optimised for speedy garbage collection without wasting a lot of memory.

                随着垃圾收集技术的改进,细节变得相当复杂,并且取决于您的 JVM 及其配置方式.如果您正在使用的特定 JVM,您应该阅读 文档你需要确切地知道发生了什么.

                With improvements in garbage collection technology the details have become pretty complex and vary depending on your JVM and how it has been configured. You should read the documentation for the specific JVM you are using if you need to know exactly what is happening.

                也就是说,有一个简单的历史安排,这在概念层面上仍然有用.从历史上看,年轻一代文案收集者Tenured Generation标记和扫描收集器.复制收集器基本上不需要 CPU 成本来清除垃圾,大部分成本是维护活动对象,这种效率的代价是更重的内存使用.标记和清除收集器会为活动对象和未使用对象支付一些 CPU 成本,但会更有效地利用内存.

                That said, there is a simple historical arrangement this is still useful at a conceptual level. Historically the Young Generation would be a copy collector and the Tenured Generation be a mark and sweep collector. A copy collector pays essentially no CPU cost for getting rid of garbage, most of the cost is in maintaining live objects, the price of this efficiency is heavier memory usage. A mark and sweep collector pays some CPU cost for both live and unused objects but utilizes memory more efficiently.

                这篇关于Young , Tenured 和 Perm 一代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何在 Java 中手动进行长时间的 Full GC 下一篇:为什么 -Xmx 和 Runtime.maxMemory 不一致

                相关文章

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

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