登录

立即登录

去注册

忘记密码?

验证码登录

点击获取验证码

立即登录

去注册

注册

点击获取验证码

立即注册

找回密码

点击获取验证码

确定

全部资讯

全部资讯   / 携程中级JAVA开发面试题集(2021年)

携程中级JAVA开发面试题集(2021年)

2021-12-25 14:10:06

<div class="WordSection1"> <p class="MsoNormal" style="margin-top:4.95pt;text-indent:2.0pt;line-height:25.0pt; mso-line-height-rule:exactly"><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.3pt">1</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">.</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.6pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .515pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">描述一下</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.35pt">&nbsp;</span><b><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt; mso-text-raise:1.0pt;letter-spacing:.2pt">J</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.35pt">V</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.5pt">M</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.6pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .515pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">加载</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.35pt">&nbsp;</span><b><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt; mso-text-raise:1.0pt;letter-spacing:.3pt">C</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">l</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">a</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">ss</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.6pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .515pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">文件的原理机</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.55pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">制</span><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">?</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:9.15pt;text-indent:1.15pt;line-height: 18.8pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;color:red; position:relative;top:-1.0pt;mso-text-raise:1.0pt">在面试<span style="letter-spacing: -.05pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;color:red;position:relative;top:-1.0pt;mso-text-raise: 1.0pt">java </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;color:red; position:relative;top:-1.0pt;mso-text-raise:1.0pt">工程师的时候<span style="letter-spacing:-1.35pt">,</span>这道题经常被问到<span style="letter-spacing: -1.35pt">,</span>故需特别注意<span style="letter-spacing:-1.35pt">。</span></span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.75pt;margin-right:.55pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:-.4pt;line-height:171%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">Jav</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">中的所有类</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">都需要由类加载器装载到 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">JV</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">M </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">中才能运行</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">类加</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> 载器本身也是一个类<span style="letter-spacing:-.1pt">,</span>而它的工作就是把<span style="letter-spacing:-.05pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri">class </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体">文件从硬盘读取到内 存中<span style="letter-spacing:-1.7pt">。</span>在写程序的时候<span style="letter-spacing:-1.7pt">,</span>我们几乎不需要关心类的加载<span style="letter-spacing: -1.65pt">,</span>因为这些都 是隐式装载的<span style="letter-spacing:-1.7pt">,</span>除非我们有特殊的用法<span style="letter-spacing:-1.7pt">,</span>像是反射<span style="letter-spacing:-1.65pt">,</span>就需要显式的加 载所需要的类<span style="letter-spacing:-.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:.15pt;margin-right:.4pt;margin-bottom: 0cm;margin-left:1.25pt;margin-bottom:.0001pt;text-indent:-.55pt;line-height: 169%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">类的加载是动态的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">它并不会一次性将所</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">有类全部加载后再运</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> 行<span style="letter-spacing:-1.25pt">,</span>而是保证程序运行的基础类</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">(</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">像是基类</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri">)</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体">完全加载到<span style="letter-spacing:-.05pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">jvm </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">中<span style="letter-spacing:-1.25pt">,</span>至于 其他类<span style="letter-spacing:-.2pt">,</span>则在需要的时候才加载<span style="letter-spacing: -.2pt">。</span>这当然就是为了节省内存开销<span style="letter-spacing:-.2pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:4.55pt;text-indent:.7pt;line-height:91%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">Java<span style="letter-spacing:-.05pt"> </span></span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体">的类加载器有三个<span style="letter-spacing:-3.65pt">,</span>对应 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">Java </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">的三种类</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">:<o:p></o:p></span></p> <p class="MsoNormal" style="line-height:102%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="text-indent:.7pt;line-height:49.1pt;mso-line-height-rule: exactly;vertical-align:middle"><span lang="EN-US"><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"/> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"/> <v:f eqn="sum @0 1 0"/> <v:f eqn="sum 0 0 @1"/> <v:f eqn="prod @2 1 2"/> <v:f eqn="prod @3 21600 pixelWidth"/> <v:f eqn="prod @3 21600 pixelHeight"/> <v:f eqn="sum @0 0 1"/> <v:f eqn="prod @6 1 2"/> <v:f eqn="prod @7 21600 pixelWidth"/> <v:f eqn="sum @8 21600 0"/> <v:f eqn="prod @7 21600 pixelHeight"/> <v:f eqn="sum @10 21600 0"/> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/> <o:lock v:ext="edit" aspectratio="t"/> </v:shapetype><v:shape id="IM_x0020_1" o:spid="_x0000_i1034" type="#_x0000_t75" style='width:415.2pt;height:49.2pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img width="554" height="66" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image001.jpg" v:shapes="IM_x0020_1"><!--[endif]--><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:180%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;margin-right:.8pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:-.05pt;line-height: 125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.4pt">三个加载器各自完成自己的工作,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">但它们是如何协调工作呢?哪一个类该由哪个类加载器完</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">成呢?为了解决这个问题</span><span style="letter-spacing:.5pt">,</span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">采用了委托模</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">型机制</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:12.5pt;margin-right:.55pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;line-height:121%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">委托模型机制的工作原理很简单</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">:</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">当类加载器需要加载类的时候</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">先请示其</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">P</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">t(</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">即</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">上一</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.55pt">层加载器</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">)</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">在其搜索路径载入</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">如果找不到</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">才在自己的搜索路径搜索该类</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">这样的顺序</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">其</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">实就是加载器层次上自顶而下</span><span style="letter-spacing: .35pt">的搜索</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">因为加载器必须保证基础类的加载</span><span style="letter-spacing: .4pt">。</span><span style="letter-spacing:.35pt">之所以是这种机</span> <span style="letter-spacing:.35pt">制,还有一个安全上的考虑:如果</span><span style="letter-spacing: .3pt">某人将一个恶意的基础类加载到</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">委托模型机制会搜</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">索其父类加载器</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.3pt">显然是不可能找到的</span><span style="letter-spacing:.4pt">,</span> <span style="letter-spacing:.3pt">自然就不会将该类加载进来</span><span style="letter-spacing: .4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:.65pt;text-indent:1.15pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">我们可以通过这样</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">的代码来获取类加载器</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.65pt;text-indent:.7pt;line-height:43.8pt; mso-line-height-rule:exactly;vertical-align:middle"><span lang="EN-US"><!--[if gte vml 1]><v:shape id="IM_x0020_2" o:spid="_x0000_i1033" type="#_x0000_t75" style='width:415.2pt; height:43.8pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image002.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img width="554" height="58" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg" v:shapes="IM_x0020_2"><!--[endif]--><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection2"> <p class="MsoNormal" style="margin-top:8.4pt;margin-right:.65pt;margin-bottom: 0cm;margin-left:.8pt;margin-bottom:.0001pt;line-height:157%"><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.45pt">注意一个很重要的问题,就是</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.45pt">在</span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.4pt">逻辑上并不存在</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.25pt">Boo</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.15pt">tstr</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.25pt">pK</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.2pt">L</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.25pt">d</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.15pt">r </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.4pt">的实</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .45pt">体</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.5pt">!</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.45pt">因为它是用</span><span style="font-family: &quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.35pt">C+</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.3pt">+</span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.4pt">编写的</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .5pt">,</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.4pt">所以打印其内容将会得到</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.25pt">nu</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.15pt">ll</span><span style="font-family: 宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.5pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:.95pt;line-height:96%"><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.5pt">前面是对类加载器的简单介绍</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.55pt">,</span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.5pt">它的原理机制非常简单</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.45pt">就是下面几个步骤</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.1pt">:</span><span lang="EN-US"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:4.9pt;text-indent:1.95pt;line-height:43.2pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;position:relative;top:-23.0pt;mso-text-raise:23.0pt; letter-spacing:.2pt">1</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;position:relative;top:-23.0pt;mso-text-raise:23.0pt; letter-spacing:.1pt">.</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;position: relative;top:-23.0pt;mso-text-raise:23.0pt;letter-spacing:.35pt">装载</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; position:relative;top:-23.0pt;mso-text-raise:23.0pt;letter-spacing:.1pt">:</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;position:relative;top:-23.0pt;mso-text-raise:23.0pt; letter-spacing:.35pt">查</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;position: relative;top:-23.0pt;mso-text-raise:23.0pt;letter-spacing:.3pt">找和导入</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; position:relative;top:-23.0pt;mso-text-raise:23.0pt;letter-spacing:.15pt">&nbsp;c</span><span lang="EN-US" style="font-family: &quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:微软雅黑;color:#4F4F4F;position:relative;top:-23.0pt; mso-text-raise:23.0pt;letter-spacing:.05pt">l</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;position:relative; top:-23.0pt;mso-text-raise:23.0pt;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; position:relative;top:-23.0pt;mso-text-raise:23.0pt;letter-spacing:.1pt">ss</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; position:relative;top:-23.0pt;mso-text-raise:23.0pt;letter-spacing:.15pt">&nbsp;</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;position: relative;top:-23.0pt;mso-text-raise:23.0pt;letter-spacing:.3pt">文件</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; position:relative;top:-23.0pt;mso-text-raise:23.0pt;letter-spacing:.05pt">;</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.4pt;line-height:20.75pt;mso-line-height-rule: exactly"><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; position:relative;top:-2.0pt;mso-text-raise:2.0pt;letter-spacing:.15pt">2</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; position:relative;top:-2.0pt;mso-text-raise:2.0pt;letter-spacing:.05pt">.</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;position:relative;top:-2.0pt;mso-text-raise:2.0pt; letter-spacing:.25pt">连接</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;position:relative;top:-2.0pt;mso-text-raise:2.0pt">:</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:160%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="text-indent:.7pt;line-height:82.8pt;mso-line-height-rule: exactly;vertical-align:middle"><span lang="EN-US"><!--[if gte vml 1]><v:shape id="IM_x0020_3" o:spid="_x0000_i1032" type="#_x0000_t75" style='width:415.2pt; height:82.8pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image003.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img width="554" height="110" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image003.jpg" v:shapes="IM_x0020_3"><!--[endif]--><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:101%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:101%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.95pt;text-indent:1.5pt;line-height:97%"><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.35pt">3</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.2pt">.</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.25pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.55pt">初始化</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.2pt">:</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.55pt">初始</span><span style="font-family: 宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.5pt">化静态变量</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .6pt">,</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.5pt">静态代码块</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.6pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:10.7pt;text-indent:.7pt;line-height:17.75pt; mso-line-height-rule:exactly;vertical-align:middle"><span lang="EN-US"><!--[if gte vml 1]><v:shape id="IM_x0020_4" o:spid="_x0000_i1031" type="#_x0000_t75" style='width:415.2pt; height:18pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image004.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img width="554" height="24" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image004.jpg" v:shapes="IM_x0020_4"><!--[endif]--><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.85pt;text-indent:.8pt;line-height:15.6pt; mso-line-height-rule:exactly"><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;position: relative;top:-2.0pt;mso-text-raise:2.0pt;letter-spacing:.5pt">来源:</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#6795B5; position:relative;top:-2.0pt;mso-text-raise:2.0pt;letter-spacing:.3pt"><a href="https://www.cnblogs.com/wenjiang/archive/2013/04/26/3044132.html"><span style="color: rgb(103, 149, 181);">h</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">tt</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.35pt;">p</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">s</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">:</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">//</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.4pt;">www</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">.</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">c</span><span style="color: rgb(103, 149, 181);">n</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.35pt;">b</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">l</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.35pt;">og</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">s</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">.</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">c</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.35pt;">o</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.45pt;">m</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">/</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.4pt;">w</span><span style="color: rgb(103, 149, 181);">en</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">j</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.1pt;">i</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">an</span><span style="color: rgb(103, 149, 181);">g</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">/</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">a</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">r</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">c</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">h</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.1pt;">i</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">ve</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">/</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">2013</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">/</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">04</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">/</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">26</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">/</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">3044132</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.1pt;">.</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">h</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">t</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.4pt;">m</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.1pt;">l</span></a></span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:19.35pt;text-indent:1.6pt;line-height: 97%"><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .55pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">2</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">.</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.3pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.9pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">什么是类</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.85pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.25pt;mso-style-textoutline-outlinestyle-linecap: flat;mso-style-textoutline-outlinestyle-join:miter;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">加载器?</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.05pt;margin-right:.55pt;margin-bottom: 0cm;margin-left:.8pt;margin-bottom:.0001pt;text-indent:.1pt;line-height:163%"><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.4pt">类加载器是一个用来加载类文件的类</span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .45pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑">&nbsp; <span style="letter-spacing:.2pt">J</span><span style="letter-spacing:.25pt">ava</span><span style="letter-spacing:.15pt"> </span></span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.4pt">源代码通过</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> j</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">av</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">ac</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">编译器编译成类</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .1pt">文件。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑">&nbsp; </span><span style="font-family: 宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .1pt">然后</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt"> JVM </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.1pt">来执行类文件中的字节码来执行程序。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑">&nbsp; </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .05pt">类加载器负责加载文件</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑">系统<span style="letter-spacing:.05pt">、</span></span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑">&nbsp; </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑">网络或其他来源的类文件。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:134%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:7.55pt;text-indent:2.05pt;line-height: 97%"><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">3</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">.</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.3pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.85pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">类加载器</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.8pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.25pt;mso-style-textoutline-outlinestyle-linecap: flat;mso-style-textoutline-outlinestyle-join:miter;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">有哪些?</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.1pt;margin-right:.2pt;margin-bottom: 0cm;margin-left:.8pt;margin-bottom:.0001pt;line-height:163%"><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.5pt">有三种默认使用的类加载器</span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .55pt">:</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑">&nbsp; <span style="letter-spacing:.35pt">Boo</span><span style="letter-spacing:.2pt">t</span><span style="letter-spacing:.25pt">s</span><span style="letter-spacing:.2pt">tr</span><span style="letter-spacing:.3pt">a</span><span style="letter-spacing:.35pt">p</span><span style="letter-spacing:.2pt"> </span></span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.5pt">类加载器</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.55pt">、</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑">&nbsp;&nbsp; <span style="letter-spacing:.3pt">Ex</span><span style="letter-spacing:.2pt">t</span><span style="letter-spacing:.3pt">e</span><span style="letter-spacing:.35pt">n</span><span style="letter-spacing:.25pt">s</span><span style="letter-spacing:.15pt">i</span><span style="letter-spacing:.35pt">on</span><span style="letter-spacing:.2pt"> </span></span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .5pt">类加载器和</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"> <span lang="EN-US" style="letter-spacing:.2pt">A</span><span lang="EN-US" style="letter-spacing:.15pt">pp</span><span lang="EN-US" style="letter-spacing: .1pt">li</span><span lang="EN-US" style="letter-spacing:.15pt">ca</span><span lang="EN-US" style="letter-spacing:.1pt">ti</span><span lang="EN-US" style="letter-spacing:.15pt">o</span><span lang="EN-US" style="letter-spacing: .1pt">n </span></span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.2pt">类加载器</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑">&nbsp; </span><span style="font-family: 宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt">每种类加载器都有设定好从哪里加载类</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.25pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:8.25pt;margin-right:2.7pt;margin-bottom: 0cm;margin-left:.9pt;margin-bottom:.0001pt;text-indent:.9pt;line-height:160%"><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt">Boo</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">tstr</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">ap</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.3pt">类加载器负责加载</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .15pt">rt</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">.j</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.3pt">中的</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .15pt">J</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">D</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">K</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.25pt">类文件</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.3pt">,</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.25pt">它是所有类加载器的父加</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .35pt">载</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">器</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑">&nbsp;&nbsp;&nbsp; <span style="letter-spacing: .25pt">Boo</span><span style="letter-spacing:.15pt">t</span><span style="letter-spacing:.2pt">s</span><span style="letter-spacing:.15pt">tr</span><span style="letter-spacing:.2pt">a</span><span style="letter-spacing:.25pt">p</span><span style="letter-spacing:.2pt">&nbsp; </span></span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">类</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">加</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">载</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">器</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">没</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">有</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">任</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">何</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">父</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">类</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">加</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">载</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">器</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">,</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑">&nbsp; </span><span style="font-family: 宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .35pt">如</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">果</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">你</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">调</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">用</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"> String.class.getClassLoader()<span style="letter-spacing:-2.6pt">&nbsp; </span></span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">,</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: -2.6pt">&nbsp; </span><span style="font-family: 宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">会</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">返</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">回</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"> null&nbsp; </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">,</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: -2.6pt">&nbsp; </span><span style="font-family: 宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">任</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">何</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">基</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">于</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">此</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">的</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">代</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">码</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">会</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">抛</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑">出</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> <span lang="EN-US" style="letter-spacing: .2pt">N</span><span lang="EN-US" style="letter-spacing:.15pt">u</span><span lang="EN-US" style="letter-spacing:.1pt">ll</span><span lang="EN-US" style="letter-spacing:.15pt">Po</span><span lang="EN-US" style="letter-spacing: .1pt">i</span><span lang="EN-US" style="letter-spacing:.15pt">n</span><span lang="EN-US" style="letter-spacing:.1pt">t</span><span lang="EN-US" style="letter-spacing:.15pt">e</span><span lang="EN-US" style="letter-spacing: .1pt">r</span><span lang="EN-US" style="letter-spacing:.15pt">Excep</span><span lang="EN-US" style="letter-spacing:.1pt">ti</span><span lang="EN-US" style="letter-spacing:.15pt">on</span><span lang="EN-US" style="letter-spacing: .1pt"> </span></span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.2pt">异常</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑">&nbsp; <span style="letter-spacing:.1pt">Boo</span><span style="letter-spacing:.05pt">tstr</span><span style="letter-spacing:.1pt">ap </span></span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">加载器被称为初始类加载器</span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .25pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.95pt;margin-right:0cm;margin-bottom: 0cm;margin-left:.85pt;margin-bottom:.0001pt;text-indent:.15pt;line-height:161%"><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.3pt">而</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">Ex</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">en</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">s</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">on</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.3pt">将加载类的请求先委托给它的父加载器</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">,</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.3pt">也就是</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt">Boo</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">tstrap</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">,</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">如果</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.55pt">没有成功加载的话</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.6pt">,</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.55pt">再从</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt"> j</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">r</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">e</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">/</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">li</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">b</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">/</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">e</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.3pt">x</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.55pt">目录下或者</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt"> j</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.3pt">v</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">.</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">e</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.3pt">x</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">.</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">d</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">s</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.5pt">系统属性定义的</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt">目录下加载类。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">Extensi</span><span lang="EN-US" style="font-family: &quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:微软雅黑;letter-spacing:.15pt">o</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.1pt">n </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">加</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt">载器由</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .05pt">sun.</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">m</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.05pt">isc.Launcher$Ext</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.1pt">C</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .05pt">lassL</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">o</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.05pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">d</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.05pt">er</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt">实现</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">。</span><span lang="EN-US"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:4.95pt;margin-right:2.6pt;margin-bottom: 0cm;margin-left:.75pt;margin-bottom:.0001pt;line-height:160%"><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.35pt">第三种默认的加载器就是</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">App</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">li</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">ca</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">on</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">类加载器了</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.4pt">。</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.35pt">它负责从</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt">c</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .1pt">l</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .15pt">ass</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">p</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">h</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.3pt">环境变</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .5pt">量中加载某些应用相关的类,</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">c</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.3pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">ss</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">pa</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.45pt">环境变量通常由</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt">-c</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">ss</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">pa</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">h</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.45pt">或</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt">-c</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">p</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.45pt">命令</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .25pt">行选项来定义,或者是</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt"> J</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">AR</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.25pt">中的</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .25pt">M</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">an</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">if</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">es</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">t </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.25pt">的</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .15pt">c</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">lasspa</span><span lang="EN-US" style="font-family: &quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:微软雅黑;letter-spacing:.05pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing:.1pt">h </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt">属性</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.25pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑">&nbsp; <span style="letter-spacing:.15pt">A</span><span style="letter-spacing:.1pt">pp</span><span style="letter-spacing:.05pt">li</span><span style="letter-spacing:.1pt">ca</span><span style="letter-spacing:.05pt">ti</span><span style="letter-spacing:.1pt">on </span></span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .2pt">类</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">加</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">&nbsp;&nbsp;</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">载</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">器</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">&nbsp;&nbsp; </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">是</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">&nbsp;&nbsp;&nbsp; Ex</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .1pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;letter-spacing: .15pt">ens</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;letter-spacing:.15pt">on &nbsp;</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;letter-spacing:.25pt">类加载器的子加载器。通过</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"> <span lang="EN-US" style="letter-spacing:.2pt">s</span><span lang="EN-US" style="letter-spacing:.3pt">un</span><span lang="EN-US" style="letter-spacing: .15pt">.</span><span lang="EN-US" style="letter-spacing:.4pt">m</span><span lang="EN-US" style="letter-spacing:.15pt">i</span><span lang="EN-US" style="letter-spacing:.2pt">s</span><span lang="EN-US" style="letter-spacing: .25pt">c</span><span lang="EN-US" style="letter-spacing:.15pt">.</span><span lang="EN-US" style="letter-spacing:.25pt">La</span><span lang="EN-US" style="letter-spacing:.3pt">un</span><span lang="EN-US" style="letter-spacing: .25pt">c</span><span lang="EN-US" style="letter-spacing:.3pt">h</span><span lang="EN-US" style="letter-spacing:.25pt">e</span><span lang="EN-US" style="letter-spacing:.2pt">r</span><span lang="EN-US" style="letter-spacing: .25pt">$</span><span lang="EN-US" style="letter-spacing:.3pt">A</span><span lang="EN-US" style="letter-spacing:.25pt">ppC</span><span lang="EN-US" style="letter-spacing:.1pt">l</span><span lang="EN-US" style="letter-spacing: .2pt">a</span><span lang="EN-US" style="letter-spacing:.15pt">ss</span><span lang="EN-US" style="letter-spacing:.2pt">L</span><span lang="EN-US" style="letter-spacing:.25pt">o</span><span lang="EN-US" style="letter-spacing: .2pt">a</span><span lang="EN-US" style="letter-spacing:.25pt">d</span><span lang="EN-US" style="letter-spacing:.2pt">e</span><span lang="EN-US" style="letter-spacing:.15pt">r </span></span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing: .4pt">实现</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;letter-spacing:.45pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:15.3pt;text-indent:.95pt;line-height:97%; mso-outline-level:1"><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.55pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:#4F4F4F;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.25pt;mso-style-textoutline-outlinestyle-linecap: flat;mso-style-textoutline-outlinestyle-join:miter;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">4</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.25pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: #4F4F4F;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">.</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.35pt"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.9pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: #4F4F4F;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">什么是</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.35pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:#4F4F4F;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.25pt;mso-style-textoutline-outlinestyle-linecap: flat;mso-style-textoutline-outlinestyle-join:miter;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.6pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: #4F4F4F;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">o</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.85pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:#4F4F4F;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.25pt;mso-style-textoutline-outlinestyle-linecap: flat;mso-style-textoutline-outlinestyle-join:miter;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">m</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.45pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: #4F4F4F;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">c</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.5pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:#4F4F4F;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.25pt;mso-style-textoutline-outlinestyle-linecap: flat;mso-style-textoutline-outlinestyle-join:miter;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.35pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: #4F4F4F;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.3pt"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.9pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: #4F4F4F;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">类加载机制?</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:108%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:4.95pt;text-indent:.8pt;line-height:97%"><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.45pt">在</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.3pt">o</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.4pt">m</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.25pt">ca</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.2pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.15pt"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.45pt">中类的加载稍有不同</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .5pt">,</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.45pt">如下</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.4pt">图</span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.5pt">:</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US"><!--[if gte vml 1]><v:shape id="IM_x0020_5" o:spid="_x0000_i1030" type="#_x0000_t75" style='width:418.8pt;height:319.2pt; visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image005.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img border="0" width="558" height="426" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image005.jpg" v:shapes="IM_x0020_5"><!--[endif]--><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:152%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.75pt;text-indent:1.9pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.1pt">当<span lang="EN-US"> tomcat </span>启</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.05pt">动时</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.1pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .05pt">会创建几种类加载器</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.75pt;text-indent:2.05pt;line-height: 92%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">1</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">Bootstrap</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">引导类加载器</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.7pt;text-indent:1.15pt;line-height:92%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.05pt">加载</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.05pt">JVM </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .05pt">启动所需的类,以及标准扩展类(位于<span lang="EN-US"> jre/lib/ext </span>下)</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.75pt;text-indent:1.3pt;line-height:92%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.25pt">2 Syste</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">系统类加载器</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.75pt;margin-right:3.1pt;margin-bottom: 0cm;margin-left:1.35pt;margin-bottom:.0001pt;text-indent:-.2pt;line-height: 109%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:-.05pt">加</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:-.55pt"> </span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:-.05pt">载</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">tomcat</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">启</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">动</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">类</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -5.85pt">,</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -5.75pt">&nbsp; </span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:-.05pt">比</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">如</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">bootstrap.jar</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -5.85pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -5.75pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">通</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">常</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">在</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">catalina.bat</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">或</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.55pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">者</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span lang="EN-US" style="letter-spacing:.05pt">catalina.sh </span><span style="letter-spacing:.05pt">中指定。位于<span lang="EN-US"> CATALINA_HO</span></span><span lang="EN-US">ME/bin<span style="letter-spacing:.05pt"> </span></span>下<span style="letter-spacing:.05pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:134%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:.05pt;text-indent:.7pt;line-height:115.9pt; mso-line-height-rule:exactly;vertical-align:middle"><span lang="EN-US"><!--[if gte vml 1]><v:shape id="IM_x0020_6" o:spid="_x0000_i1029" type="#_x0000_t75" style='width:400.8pt; height:115.8pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image006.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img border="0" width="534" height="154" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image006.jpg" v:shapes="IM_x0020_6"><!--[endif]--><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:194%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:5.0pt;text-indent:1.5pt;line-height:97%"><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.4pt">3</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.45pt">C</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.4pt">o</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.6pt">mm</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.4pt">on</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .65pt">通用</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.6pt">类加载器</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:8.3pt;margin-right:21.95pt;margin-bottom: 0cm;margin-left:.85pt;margin-bottom:.0001pt;text-indent:-.1pt;line-height:163%"><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.45pt">加载</span><span style="font-family: &quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.2pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.3pt">o</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.4pt">m</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.25pt">ca</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.45pt">使用以及应用通用的一些类,位于</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.3pt">CA</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.25pt">T</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.3pt">A</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.2pt">L</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.1pt">I</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.3pt">N</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.25pt">A</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.15pt">_</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.3pt">HO</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.35pt">M</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.2pt">E</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.15pt">/</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.1pt">li</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.25pt">b</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.4pt">下</span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.45pt">,</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .4pt">比</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.4pt">如</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.25pt">e</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.2pt">rv</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.15pt">t-</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.25pt">p</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.1pt">i.j</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:8.35pt;text-indent:.7pt;line-height:282.45pt; mso-line-height-rule:exactly;vertical-align:middle"><span lang="EN-US"><!--[if gte vml 1]><v:shape id="IM_x0020_7" o:spid="_x0000_i1028" type="#_x0000_t75" style='width:436.2pt; height:282.6pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image007.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img border="0" width="582" height="377" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image007.jpg" v:shapes="IM_x0020_7"><!--[endif]--><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:175%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.7pt;text-indent:1.1pt;line-height:92%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.25pt">4 webapp </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">应用类</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">加载器</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:112%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.75pt;margin-right:20.6pt;margin-bottom: 0cm;margin-left:.8pt;margin-bottom:.0001pt;text-indent:.35pt;line-height:109%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:1.1pt">每个应用在部署后</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:1.15pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:1.1pt">都会</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: 1.05pt">创建一个唯一的类加载器</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: 1.15pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: 1.05pt">该类加载器会加载位于</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> WEB-INF/lib<span style="letter-spacing:-.05pt"> </span></span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体">下的<span lang="EN-US"> jar </span>文件中的<span lang="EN-US"> class </span>和<span lang="EN-US"> WEB-INF/classes </span>下的<span lang="EN-US"> class </span>文件<span style="letter-spacing:-3.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.15pt;text-indent:1.9pt;line-height: 94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.45pt">当应用需要到某个类时,则会按照下</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">面的顺序进行类加载</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:110%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.75pt;text-indent:2.05pt;line-height: 92%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">1 </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">使</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">用</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">bootstrap</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">引导类加载器加载</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.8pt;text-indent:1.3pt;line-height:92%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.05pt">2 </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.05pt">使用<span lang="EN-US"> system </span>系统类加载</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">器加载<span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:3.75pt;text-indent:1.4pt;line-height:94%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.1pt">3</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">使用应用类加载器在</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.1pt">WEB-INF/c</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.05pt">lasses</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.15pt">中加载</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.75pt;text-indent:1.1pt;line-height:94%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.1pt">4 </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">使用应用类加载器在</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.1pt"> WE</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.05pt">B-INF/lib</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.1pt"> </span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.15pt">中加载</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.75pt;text-indent:1.4pt;line-height:92%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">5<span style="letter-spacing:-.1pt"> </span></span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">使用<span style="letter-spacing:-.1pt"> </span><span lang="EN-US">common<span style="letter-spacing:-.1pt"> </span></span>类加载器在<span style="letter-spacing:-.1pt"> </span><span lang="EN-US">CATALINA_HOME/lib<span style="letter-spacing:-.1pt"> </span></span>中加载<span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.15pt;line-height: 95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;color:#00B0F0;letter-spacing:.5pt">参考:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;color:#00B0F0;letter-spacing:.25pt">https://blog.csdn.net/dreamcatcher1314/article/detai</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;color:#00B0F0;letter-spacing:.2pt">ls/78271251</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection3"> <p class="MsoNormal" style="margin-top:6.95pt;text-indent:1.75pt;line-height: 23.2pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .515pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">5</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.5pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .515pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">类加载器双亲委派模型机</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.4pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">制?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:125%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoListParagraph" style="margin-top:3.7pt;margin-right:0cm;margin-bottom: 0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-indent:-21.0pt;mso-char-indent-count: 0;line-height:92%;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span lang="EN-US" style="font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings">l<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp; </span></span><!--[endif]--><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">什么是双亲委派模型</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">(Parent-Delegatio</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.2pt">Model)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">?为什么使用双亲委派模型?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.7pt;margin-right:3.15pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:108%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">JVM </span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">中加载类机制采用的是双亲委派模型</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">顾名思义</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">在该模型中</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">子类</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">加载器</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">收到的加载请求</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">不会先去处理</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">而是先把请求委派给父类加载器处理</span><span style="letter-spacing: .4pt">,</span><span style="letter-spacing:.35pt">当父</span><span style="letter-spacing:.3pt">类</span> <span style="letter-spacing:.45pt">加载器处理不了时再返回给子类加载器加</span><span style="letter-spacing:.4pt">载</span><span style="letter-spacing:.5pt">;</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoListParagraph" style="margin-top:5.0pt;margin-right:0cm;margin-bottom: 0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-indent:-21.0pt;mso-char-indent-count: 0;line-height:97%;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span lang="EN-US" style="font-family:Wingdings;mso-fareast-font-family:Wingdings; mso-bidi-font-family:Wingdings">l<span style="font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 7pt; line-height: normal; font-family: &quot;Times New Roman&quot;;">&nbsp; </span></span><!--[endif]--><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.45pt">为什么使用双亲委</span><span style="font-family: 宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.4pt">派模型?</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:4.9pt;margin-right:3.15pt;margin-bottom: 0cm;margin-left:.8pt;margin-bottom:.0001pt;text-indent:.85pt;line-height:158%"><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.35pt">因为安全。使用双亲委派模型来组织类加载器间的关系,能</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.3pt">够使类的加载也具有</span><span style="font-family: &quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:微软雅黑;color:#4F4F4F"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.5pt">层</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .45pt">次关系</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.45pt">这样能够保证核心基础的</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.2pt"> J</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.2pt"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.45pt">类会被根加载器加载</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family: 微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing:.45pt">而不会去加载</span><span style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F"> </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.25pt">用户自定义的和基础类库相同名字的类</span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.35pt">,</span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.25pt">从而保证系统的有序</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .35pt">、</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F">&nbsp; </span><span style="font-family:宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.25pt">安全</span><span style="font-family: 宋体;mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.35pt">。</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:5.7pt;text-indent:1.55pt;line-height:92%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.25pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">6.</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.25pt"> Java </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .515pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">内存</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .515pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">分配?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.8pt;text-indent:1.35pt;line-height:94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">一<span style="letter-spacing:-.1pt">、</span><span lang="EN-US" style="letter-spacing:-1.55pt">&nbsp; </span>基本概念<span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:1.55pt;margin-right:.1pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.05pt;line-height: 105%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.05pt">每运行一个<span lang="EN-US"> ja</span></span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体">va<span style="letter-spacing:.05pt"> </span></span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体">程序会产生一个<span style="letter-spacing:.05pt"> </span><span lang="EN-US">java<span style="letter-spacing:.05pt"> </span></span>进程<span style="letter-spacing:.05pt">,</span>每个<span style="letter-spacing:.05pt"> </span><span lang="EN-US">java<span style="letter-spacing:.05pt"> </span></span>进程可能包含一个或者 <span style="letter-spacing: .05pt">多个线程,每一个<span lang="EN-US"> Jav</span></span><span lang="EN-US">a<span style="letter-spacing:.05pt"> </span></span>进程对应唯一一个<span style="letter-spacing: .05pt"> </span><span lang="EN-US">JVM<span style="letter-spacing:.05pt"> </span></span>实例<span style="letter-spacing:.05pt">,</span>每一个<span style="letter-spacing:.05pt"> </span><span lang="EN-US">JVM<span style="letter-spacing:.05pt"> </span></span>实例唯一对应 <span style="letter-spacing:.35pt">一个堆</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.35pt">每一个线程有一个自己私有的栈</span><span style="letter-spacing: .4pt">。</span><span style="letter-spacing:.35pt">进程所创建的所有类的实例(也就是</span> <span style="letter-spacing:.55pt">对象</span><span style="letter-spacing:.6pt">)</span><span style="letter-spacing:.55pt">或数组(指的是</span><span style="letter-spacing:.5pt">数组的本身</span><span style="letter-spacing:.6pt">,</span><span style="letter-spacing:.5pt">不是引用</span><span style="letter-spacing:.6pt">)</span><span style="letter-spacing:.5pt">都放在堆中</span><span lang="EN-US" style="letter-spacing:.3pt">,</span><span style="letter-spacing: .5pt">并由该进程所有的</span> <span style="letter-spacing:.3pt">线程共享。</span><span lang="EN-US" style="letter-spacing:.15pt">Java </span><span style="letter-spacing: .3pt">中分配堆内存是自</span><span style="letter-spacing:.25pt">动初始化的</span><span style="letter-spacing:.3pt">,</span><span style="letter-spacing:.25pt">即为一个对象分配内存的时候</span><span style="letter-spacing:.3pt">,</span> <span style="letter-spacing:.3pt">会初始化这个对象中变量。虽然</span><span lang="EN-US" style="letter-spacing:.15pt">Java </span><span style="letter-spacing: .25pt">中所有对象的存储空间都是在堆中分配的</span><span style="letter-spacing:.3pt">,</span> <span style="letter-spacing:.55pt">但是这个对象的引用却是在栈中分配</span><span lang="EN-US" style="letter-spacing:.25pt">,</span><span style="letter-spacing:.5pt">也就是说在建立一个对象时在堆和栈中都</span> <span style="letter-spacing:.35pt">分配内存</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.35pt">在堆中分配的内存实际存放这个被创建的对象的本身</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">而在栈中分配</span> <span style="letter-spacing:.55pt">的内存只是</span><span style="letter-spacing: .5pt">存放指向这个堆对象的引用而已</span><span style="letter-spacing:.6pt">。</span><span style="letter-spacing:.5pt">局部变量</span><span style="letter-spacing:.35pt"> </span><span lang="EN-US" style="letter-spacing:.3pt">new</span><span lang="EN-US" style="letter-spacing:.35pt"> </span><span style="letter-spacing:.5pt">出来时</span><span style="letter-spacing:.6pt">,</span><span style="letter-spacing:.5pt">在栈空间</span> <span style="letter-spacing:.35pt">和堆空间中分配空间</span><span style="letter-spacing: .4pt">,</span><span style="letter-spacing:.35pt">当局部变量生命周期结束后</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">栈空间立刻被回收</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">堆空间</span> 区域等待<span style="letter-spacing:-.05pt"> </span><span lang="EN-US">GC </span>回收<span style="letter-spacing:-2.3pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:13.75pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.4pt;margin-bottom:.0001pt;line-height:110%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">具体的概念<span style="letter-spacing:-.45pt">:</span><span lang="EN-US">JVM<span style="letter-spacing:-.05pt"> </span></span>的内存可分为<span style="letter-spacing:-.05pt"> </span><span lang="EN-US">3<span style="letter-spacing: -.05pt"> </span></span>个区<span style="letter-spacing:-.45pt">:</span>堆<span lang="EN-US">(heap)</span><span style="letter-spacing:-.45pt">、</span>栈<span lang="EN-US">(stack)</span>和方法区<span lang="EN-US">(method</span><span style="letter-spacing:-.45pt">,</span> <span style="letter-spacing:.3pt">也叫静态区</span><span lang="EN-US" style="letter-spacing:.15pt">)</span><span style="letter-spacing: .35pt">:<span lang="EN-US"><o:p></o:p></span></span></span></p> <p class="MsoNormal" style="margin-top:13.75pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.4pt;margin-bottom:.0001pt;line-height:110%"><b><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">堆</span></b><b><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.1pt">区</span></b><b><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.2pt">:</span></b><b><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></b></p> <p class="MsoNormal" style="line-height:109%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.75pt;margin-right:3.15pt;margin-bottom: 0cm;margin-left:2.1pt;margin-bottom:.0001pt;text-indent:-1.0pt;line-height: 104%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.35pt">存储的全部是对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">每个对象都包含一个与之对应的</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt"> class </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">的信息</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">(c</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">lass</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">的目</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">的是得到</span><span style="letter-spacing:.3pt">操作指令</span><span lang="EN-US" style="letter-spacing:.15pt">)</span><span lang="EN-US"> </span><span style="letter-spacing:.35pt">;</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:.05pt;text-indent:1.6pt;line-height:92%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.1pt">jvm </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.1pt">只有一个堆区<span lang="EN-US">(heap)</span></span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.1pt">且被所有线程</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .05pt">共享</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .05pt">堆中不存放基本类型和对象引用</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">,</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection4"> <p class="MsoNormal" style="margin-top:2.35pt;text-indent:1.85pt;line-height: 15.6pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-2.5pt;mso-text-raise:2.5pt;letter-spacing:.4pt">只存放对</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-2.5pt;mso-text-raise:2.5pt; letter-spacing:.35pt">象本身和数组本身</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-2.5pt;mso-text-raise:2.5pt;letter-spacing:.4pt">;</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.15pt;line-height:94%"><b><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">栈区</span></b><b><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">:</span></b><b><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></b></p> <p class="MsoNormal" style="line-height:110%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.75pt;margin-right:14.25pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;line-height:104%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">每个线程包含一个栈区</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">栈中只保存基础数据类型本身和自定义</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">对象的引用</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">;</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">每个栈中的数</span><span style="letter-spacing:.45pt">据</span><span lang="EN-US" style="letter-spacing:.25pt">(</span><span style="letter-spacing: .45pt">原始类型和对象引用</span><span lang="EN-US" style="letter-spacing:.25pt">)</span><span style="letter-spacing:.45pt">都是私有的</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">其他栈不能访问</span><span style="letter-spacing:.55pt">;</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:.05pt;margin-right:4.0pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;line-height:104%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">栈分为</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt"> 3 </span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">个部分</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">:</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">基本类型变量区</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">执行环境上下文</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">操作指令区</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">(</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">存放操作指</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.05pt">令<span lang="EN-US">)</span></span><span style="letter-spacing:.1pt">;</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="text-indent:1.2pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">方法区(静态区)<span style="letter-spacing:-.05pt"> </span><span lang="EN-US">:<o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:110%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.75pt;margin-right:3.75pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;line-height:104%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">被所有的线程共享</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">方法区包含所有的</span><span lang="EN-US" style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> class</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">(</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">class </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">是指类的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">原始代码</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">要创</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.2pt">建一个类的对象,首先要把该类的代码加载到方法区中,并且初</span><span style="letter-spacing:.15pt">始化</span><span style="letter-spacing:.2pt">)</span><span style="letter-spacing:.15pt">和 </span><span lang="EN-US" style="letter-spacing: .05pt">static</span><span lang="EN-US"> </span><span style="letter-spacing:.15pt">变量</span><span style="letter-spacing:.3pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:.05pt;text-indent:1.2pt;line-height:94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">方法区中包含的都是在整个程序中永远唯一的元素</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">如</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">class</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">st</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">atic</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">变量</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:110%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.75pt;text-indent:1.35pt;line-height: 15.6pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-2.5pt;mso-text-raise:2.5pt;letter-spacing:.4pt">二</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-2.5pt;mso-text-raise:2.5pt; letter-spacing:.45pt">、</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-2.5pt;mso-text-raise:2.5pt;letter-spacing:.4pt">实</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-2.5pt;mso-text-raise:2.5pt; letter-spacing:.35pt">例演示</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:.8pt;line-height:92%"><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">AppMain.jav</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:173%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:.05pt;text-indent:.7pt;line-height:237.95pt; mso-line-height-rule:exactly;vertical-align:middle"><span lang="EN-US"><!--[if gte vml 1]><v:shape id="IM_x0020_8" o:spid="_x0000_i1027" type="#_x0000_t75" style='width:415.2pt; height:238.2pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image008.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img border="0" width="554" height="318" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image008.jpg" v:shapes="IM_x0020_8"><!--[endif]--><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:159%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;margin-right:3.5pt;margin-bottom: 0cm;margin-left:.85pt;margin-bottom:.0001pt;text-indent:.2pt;line-height:122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">运<span style="letter-spacing:-.05pt"> </span>行 该程序 时 <span style="letter-spacing:-1.95pt">,</span><span style="letter-spacing:-5.0pt"> </span>首 先 启动 一个 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri">Java&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">虚拟机进程 <span style="letter-spacing:-1.95pt">,</span><span style="letter-spacing:-5.0pt"> </span>这个进程 首 先从 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">classpath&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体">中找 到 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">App</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.45pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">.</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">ss </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">文件</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">读取这个文件中的二进制数据</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">然后把</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">App</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.4pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">类的类信息存放到运</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">行时数据区的方法区中,这就是</span><span style="letter-spacing: .25pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">A</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">类的加载过程</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.6pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:-.05pt;line-height: 126%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.3pt">接着</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">Java</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">虚拟机定位到方法区中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">App</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">类的</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">方法的字节码</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">开始执行它的指</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">令</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">这个</span><span style="letter-spacing:.15pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">in</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">方法的第一条语句就是</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:143%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:.05pt;text-indent:.7pt;line-height:21.85pt; mso-line-height-rule:exactly;vertical-align:middle"><span lang="EN-US"><!--[if gte vml 1]><v:shape id="IM_x0020_9" o:spid="_x0000_i1026" type="#_x0000_t75" style='width:415.2pt; height:21.6pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image009.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img border="0" width="554" height="29" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image009.jpg" v:shapes="IM_x0020_9"><!--[endif]--><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection5"> <p class="MsoNormal" style="margin-top:3.0pt;text-indent:1.25pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">该</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">语句的执行过程</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:3.4pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.45pt;line-height:117%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">1</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">、</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">虚拟机到方法区找到</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">类的类型信息,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">没有找到</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">因为</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">类还没有加载</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">到方法区(这里可以看出</span><span style="letter-spacing:.45pt">,</span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.15pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">ava </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">中的内部类是单独存在的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">而且刚开始的时候不会跟随包含</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">类一起被加载,等到要用的时候才被加载)。</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">虚拟机</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">立马加载</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">Sa</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">e </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">类</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">把</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">Sa</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">e </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">类</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">的类型信息存放在</span><span style="letter-spacing: .4pt">方法区里</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:3.4pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.2pt;line-height:117%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">2</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">、</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">虚拟机首先在堆区中为一个新的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">Sa</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">实例分配内存</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">并在</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">实例的内存中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">存放一个方法区中存放</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.2pt">Sa</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">类的类型信息的内存地址</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:120%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:4.0pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.15pt;line-height: 112%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.25pt">3</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">、</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">V</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.4pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">的进程中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">每个线程都会拥有一个方法调用栈</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">用来跟踪线</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">程运行中一系列的方法</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">调用过程,栈中的每一个元素就被</span><span style="letter-spacing: .35pt">称为栈帧</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">每当线程调用一个方法的时候就会向方法栈压</span> <span style="letter-spacing:.5pt">入一个新帧</span><span style="letter-spacing:.55pt">。</span><span style="letter-spacing:.5pt">这里的帧用来存</span><span style="letter-spacing:.45pt">储方法的参数</span><span style="letter-spacing:.55pt">、</span><span style="letter-spacing:.45pt">局部变量和运算过程中的临时数据</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:111%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:2.7pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:-.15pt;line-height: 122%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.05pt">4 </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .05pt">、位于</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">“=”</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.05pt">前的 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">Test1 </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .05pt">是一个在 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">main()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.05pt">方法中定义的一个变量(</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.05pt">一个 </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">Sample </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体">对象的引用<span style="letter-spacing:.05pt">),</span> <span style="letter-spacing:.3pt">因此</span><span style="letter-spacing:.35pt">,</span><span style="letter-spacing:.3pt">它被会添加到了执行</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.25pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">方法的主线程的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">AVA</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">方法调用栈中</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">而</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">“=</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">”</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">将把这个</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">st</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">1</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">变量指向堆区中</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">Sa</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">e </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">实例</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.7pt;margin-right:3.4pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.1pt;line-height:117%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">5</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:-.65pt">、</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">JVM<span style="letter-spacing:-.05pt"> </span></span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体">在堆区里继续创建另一个<span style="letter-spacing:-.05pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">Sample </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">实例<span style="letter-spacing:-.65pt">,</span>并在 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri">main </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体">方法的方法调用栈中添加一个 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">Test2 </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.35pt">变量</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">该变量指向堆区中刚才创建的</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">Sa</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">新</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">实例</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:106%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:3.0pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:.05pt;line-height: 118%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri">6</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: -.05pt">、</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri">JVM<span style="letter-spacing:-.05pt"> </span></span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">依次执行它们的<span style="letter-spacing:-.05pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">printName()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">方法<span style="letter-spacing:-.05pt">。</span>当 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">JAVA </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">虚拟机执行 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">test1.printName()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">方法时<span style="letter-spacing:-.05pt">,</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">JAVA </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.35pt">虚拟机根据局部变量</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">st</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">1</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">持有的引</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">用</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">定位到堆区中的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">实例</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">再根据</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">实例</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.3pt">持有的引用</span><span style="letter-spacing: .35pt">,</span><span style="letter-spacing:.3pt">定位到方法去中</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.15pt">Sa</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">类的类型信息</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">从而获得</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">N</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">()</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">方法的字节码</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.5pt;text-indent:1.05pt;line-height:32.9pt; mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.35pt">接着执行</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.2pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.25pt">N</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.3pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.15pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.1pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.3pt">方法包含的指令</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.35pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.3pt">开始执行</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.35pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.1pt;line-height:13.3pt;mso-line-height-rule: exactly"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.35pt">三</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.3pt">辨析</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:107%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.05pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">在</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">语言里堆</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">he</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.3pt">和栈</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.1pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.15pt">stack</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">)</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">里的区别</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.35pt">:</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:3.15pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:126%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">栈</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">(st</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ack</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">)</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">与堆</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">heap</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">都是</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">用来在</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Ra</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">中存放数据</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">的地方</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">。</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">与</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">C++</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">不同</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">ava&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">自动管理栈</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">和堆</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">程序员不能直接地设置</span><span style="letter-spacing:.4pt">栈或堆</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:.15pt;margin-right:.45pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:120%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">栈的优势是</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.6pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">存</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">取速度比堆要快</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">仅次于直接位于</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">CP</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">U</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">中的寄存器</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.6pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">但缺点是</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">存在栈中</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> 的数据大小与生存期必须是确定的<span style="letter-spacing:-.35pt">,</span>缺乏灵活性<span style="letter-spacing:-.35pt">。</span>另外<span style="letter-spacing:-.35pt">,</span>栈数据可以共享(详见下面的介绍<span style="letter-spacing: -.35pt">)</span><span style="letter-spacing:-.3pt">。</span> <span style="letter-spacing:.4pt">堆的优势是可以动态地分配内存大小,生存期也不必事先告</span><span style="letter-spacing:.35pt">诉编译器</span><span style="letter-spacing:.4pt">,</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">的垃圾收集器会</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.1pt;margin-right:1.05pt;margin-bottom: 0cm;margin-left:.7pt;margin-bottom:.0001pt;text-indent:2.05pt;line-height:232%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">自动收走这些不再使用的数据</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">但缺点是</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">由于要在运行时动态分配内存</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">存取</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">速度较慢</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">Java </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">中的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">2</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">种数据类</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">型</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.2pt;margin-right:0cm;margin-bottom:0cm; margin-left:1.15pt;margin-bottom:.0001pt;text-indent:.1pt;line-height:122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">一种是基本类型</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.45pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">y</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">pe</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">s</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">共有</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">8</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">类,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.55pt">即</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> <span style="letter-spacing:.25pt">s</span><span style="letter-spacing:.3pt">ho</span><span style="letter-spacing:.2pt">rt</span><span style="letter-spacing:.15pt">,</span> <span style="letter-spacing:.15pt">l</span><span style="letter-spacing:.3pt">ong</span><span style="letter-spacing:.15pt">,</span> <span style="letter-spacing:.3pt">b</span><span style="letter-spacing:.25pt">y</span><span style="letter-spacing:.2pt">t</span><span style="letter-spacing:.3pt">e</span><span style="letter-spacing:.15pt">,</span> <span style="letter-spacing:.2pt">f</span><span style="letter-spacing:.15pt">l</span><span style="letter-spacing:.3pt">o</span><span style="letter-spacing:.25pt">a</span><span style="letter-spacing:.15pt">t</span><span style="letter-spacing:.1pt">,</span> <span style="letter-spacing:.25pt">doub</span><span style="letter-spacing:.1pt">l</span><span style="letter-spacing:.25pt">e</span><span style="letter-spacing:.1pt">,</span> <span style="letter-spacing:.25pt">boo</span><span style="letter-spacing:.1pt">l</span><span style="letter-spacing:.25pt">ean</span><span style="letter-spacing:.1pt">,</span> <span style="letter-spacing:.25pt">c</span><span style="letter-spacing:.3pt">h</span><span style="letter-spacing:.25pt">a</span><span style="letter-spacing:.2pt">r(</span></span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">注意,并没有</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">str</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">g</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">的基本类型</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">。这种类型的定义是通过诸如</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">=</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">3</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> <span style="letter-spacing:.15pt">l</span><span style="letter-spacing:.3pt">o</span><span style="letter-spacing:.25pt">n</span><span style="letter-spacing:.2pt">g</span><span style="letter-spacing:.15pt"> </span><span style="letter-spacing:.25pt">b</span><span style="letter-spacing:.15pt"> </span><span style="letter-spacing:.2pt">=</span><span style="letter-spacing:.15pt"> </span><span style="letter-spacing:.2pt">255L</span><span style="letter-spacing:.1pt">;</span> </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">形式来定义的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">称为自动变量</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">自动变量存的是字面值</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">不是类的实例</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">即不是类的引用</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.05pt">这里并没有类的存在。如 </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">int a = 3;</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体">这里的<span style="letter-spacing:.05pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">a<span style="letter-spacing:.05pt"> </span></span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体">是一个指向<span style="letter-spacing:.05pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">int<span style="letter-spacing:.05pt"> </span></span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体">类型的引用<span style="letter-spacing:.05pt">,</span>指向<span style="letter-spacing: .05pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri">3<span style="letter-spacing:.05pt"> </span></span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">这个字面值<span style="letter-spacing:.05pt">。</span> <span style="letter-spacing:.45pt">这些字面值</span><span style="letter-spacing:.4pt">的数据</span><span style="letter-spacing:.5pt">,</span> <span style="letter-spacing:.4pt">由于大小可知</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.4pt">生存期可知</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">(</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">这些字面值固定定义在某个程序块里面</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">,</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;line-height:122%;font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection6"> <p class="MsoNormal" style="margin-top:2.75pt;line-height:14.0pt;mso-line-height-rule: exactly"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.4pt">程序块退出后</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">字段值就消失了</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.15pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">出于追求速度的原因</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">就存</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.35pt">在于栈中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:116%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:2.35pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;line-height:123%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">栈有一个很重要的特性</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">:</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">存在栈中的数据可以共享。</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">假设我们同时定义</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> <span style="letter-spacing:.1pt">i</span><span style="letter-spacing:.2pt">n</span><span style="letter-spacing:.1pt">t</span><span style="letter-spacing:.15pt"> </span><span style="letter-spacing:.2pt">a</span><span style="letter-spacing:.15pt"> </span><span style="letter-spacing:.2pt">=</span><span style="letter-spacing:.15pt"> </span><span style="letter-spacing:.2pt">3</span><span style="letter-spacing:.1pt">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="letter-spacing:.1pt">i</span><span style="letter-spacing:.2pt">n</span><span style="letter-spacing:.1pt">t</span><span style="letter-spacing:.15pt"> </span><span style="letter-spacing:.2pt">b</span><span style="letter-spacing:.15pt"> </span><span style="letter-spacing:.2pt">=</span><span style="letter-spacing:.15pt"> </span><span style="letter-spacing:.2pt">3</span><span style="letter-spacing:.1pt">;</span> </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">编译器先处理</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">=</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">3</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">;首先它会在栈中</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">创建一个变量为</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">的引用</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">然后查找有没有字面值</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.2pt">为</span><span style="letter-spacing:.15pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">3</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">的地址</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">如果没找到</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">就开辟一个存放</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">3</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">这个字面值的地址</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">然后将</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">a </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">指向</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">3</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">的地址</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.2pt">接着处理</span><span style="letter-spacing:.15pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">int b = 3 </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">;在创建完</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">b </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">的引用变</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.15pt">量后</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">由于在栈中已经有 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">3</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">这个字面值</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">便将 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">b</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">直</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.15pt">接指向</span><span style="letter-spacing:.1pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">3 </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">的地址。这样,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">就出现了 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">与 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">b</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">同时均指向 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">3</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">的情况</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.9pt;margin-right:5.3pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:117%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">这种字面值的引用与类对象的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">引用不同</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">假定两个类对象的引用同时指向一个对象</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">如果一</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">个对象引用变量修改了这个对象</span><span style="letter-spacing: .35pt">的内部状态</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">那么另一个对象引用变量也即刻反映出这个变</span> <span style="letter-spacing:.4pt">化。相反,通过字面值的引用来</span><span style="letter-spacing: .35pt">修改其值</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">不会导致另一个指向此字面值的引用的值也跟着</span> <span style="letter-spacing:.4pt">改变的情况</span><span style="letter-spacing:.45pt">。</span><span style="letter-spacing:.4pt">如上</span><span style="letter-spacing:.35pt">例</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.35pt">我们定义完</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">与</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">b</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">的值后</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">再令</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a=4</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">;</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">那么</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">b</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">不会等于</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">4</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">还是等</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">于</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">3</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">在编译器内部</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">遇到</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a=4</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">;</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">时</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">它就会重新搜索栈中是否有</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">4</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">的字面值</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">如果没有</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.2pt">重新开辟地址存放</span><span style="letter-spacing:.15pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">4</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">的值</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">如果已经有了</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">则直接将</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">a </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">指向这个地址</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.2pt">因此</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">a </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">值的改变不</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">会</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.05pt">影响到 </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">b </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体">的值<span style="letter-spacing:.05pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:.1pt;margin-right:1.55pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:21.2pt;line-height: 121%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.25pt">另一种是包装类数据,如</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">I</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ege</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">r,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"> <span style="letter-spacing:.1pt">S</span><span style="letter-spacing:.05pt">tri</span><span style="letter-spacing:.1pt">ng</span><span style="letter-spacing:.05pt">,</span> <span style="letter-spacing:.1pt">Doub</span><span style="letter-spacing:.05pt">l</span><span style="letter-spacing:.1pt">e </span></span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">等将相应的基本数据类型包装起来的类</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.45pt">这些类数据全部存在于堆中,</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">用</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ne</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">w</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">语句来显示地告诉编译器</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">在运行时才根据需要</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">动</span><span style="letter-spacing:.45pt">态创建</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">因此比较灵活</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">但缺点是要占用更多的时间</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:125%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:125%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:5.7pt;text-indent:1.4pt;line-height:93%"><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">7</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">.</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">&nbsp; </span><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">J</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">ava</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">堆的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">结构是什么样子的?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:151%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:5.45pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:-.4pt;line-height:125%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">V</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.45pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">的堆是运行时数据区,所有类的实例和数组都是</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">在堆上分配内存</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">它在</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">V</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.4pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">启动的时</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">候被创建。对象所占的堆内存</span><span style="letter-spacing: .45pt">是由自动内存管理系统也就是垃圾收集器回收</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.3pt;margin-right:5.45pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.05pt;line-height: 123%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.4pt">堆内存是由存活和死亡的对象组</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">成的</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">。</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">存活的对象是应用可以访问的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">不会被垃圾回收</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">死</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">亡的对象是应用不可访问尚且还没</span><span style="letter-spacing: .35pt">有被垃圾收集器回收掉的对象</span><span style="letter-spacing:.4pt">。</span><span style="letter-spacing:.35pt">一直到垃圾收集器把这些</span> <span style="letter-spacing: .45pt">对象回收掉之前</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">他们会一直占据堆内存空间</span><span style="letter-spacing: .55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.25pt;margin-right:5.1pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.05pt;line-height:115%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">永久代是用于存放静态文件</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.6pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">如</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">类</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">、</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">方法等</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">持久代对垃圾回收没有显著影响</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">但是</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">有些应用可能动态生成或者调用一些</span><span style="letter-spacing: .15pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">lass</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">例如</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">H</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">be</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">na</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">e&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">等</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">在这种时候需要设置一个比</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">较大的持久代空间来存</span><span style="letter-spacing:.45pt">放这些运行过程中新增的类</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">永久代中一般包含</span><span style="letter-spacing:.5pt">:</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="text-indent:1.1pt;line-height:15.6pt;mso-line-height-rule: exactly"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;position:relative;top:-2.0pt;mso-text-raise: 2.0pt;letter-spacing:.25pt">类的方</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-2.0pt;mso-text-raise:2.0pt;letter-spacing:.2pt">法</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-2.0pt;mso-text-raise:2.0pt;letter-spacing:.05pt">(</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-2.0pt;mso-text-raise:2.0pt; letter-spacing:.2pt">字节码</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-2.0pt;mso-text-raise:2.0pt; letter-spacing:.15pt">…</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-2.0pt;mso-text-raise:2.0pt; letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-2.0pt;mso-text-raise:2.0pt;letter-spacing:.05pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.1pt;line-height:14.0pt;mso-line-height-rule: exactly"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.5pt">类名</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.15pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.25pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">ng</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.15pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">对象</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.1pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.6pt;text-indent:1.45pt;line-height:14.0pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.15pt">.</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.15pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">ss</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.15pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">文件读</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.4pt">到的常量信息</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.6pt;text-indent:1.15pt;line-height:14.0pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.15pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">ss</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.15pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.45pt">对象相关的对象列表和类</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.4pt">型列表</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.25pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">.</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">g</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">.,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.4pt">方法对象的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.25pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">rr</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">y</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">).</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.35pt;text-indent:.7pt;line-height:15.6pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.3pt">V</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.45pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.15pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.5pt">创建的内部对象</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.05pt;text-indent:.7pt;line-height:94%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">I</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">T</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">编译器优化用的信息</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.15pt;line-height: 94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.45pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.299pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">虚拟机中的共划分为三个代</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.299pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.55pt;text-indent:1.15pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">年轻代(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">Young</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt; mso-text-raise:1.0pt;letter-spacing:.05pt">Generation</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">)、</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">年老代(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">Old</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">Generation</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">和持久代(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">Permanent</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.1pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">Generation</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">)。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.3pt;margin-right:59.8pt;margin-bottom: 0cm;margin-left:1.25pt;margin-bottom:.0001pt;text-indent:-.1pt;line-height: 125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.4pt">其中持久代主要存放的是</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">类的类信息,与垃圾收集要收集</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">ava</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">对象关系</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">不大</span><span style="letter-spacing:.55pt">。</span><span style="letter-spacing:.45pt">年轻代和年老代的划分是对垃</span><span style="letter-spacing: .3pt"> </span><span style="letter-spacing:.45pt">圾收集影响比较大的</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection7"> <p class="MsoNormal" style="line-height:127%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.15pt;line-height: 95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.4pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.299pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">年</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.299pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">轻代</span><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">:</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.05pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;line-height:119%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">所有新生成的对象首先都是放在年轻代的。年轻代的目标就是尽可</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">能快速的收集掉那些生</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">命周期短的对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">年轻代分三个区</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">一个</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">Eden</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">区</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">两个</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">rv</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">区</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">(</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">一般而言</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">大部分对</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> 象在 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">Eden </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">区中生成<span style="letter-spacing:-1.95pt">。</span>当 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri">Eden </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体">区满时<span style="letter-spacing:-1.95pt">,</span>还存活的对象将被复制到 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">Survivor </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">区(两个中的一个<span style="letter-spacing:-1.95pt">),</span> <span style="letter-spacing:.4pt">当这个</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">Su</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">vo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">区满时,此区的存活对象将被复制到另外一个</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">Su</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">vo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">区</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">当这个</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Su</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">vo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">去也满了的时候</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">从第一个</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">区复制过来的并且此时还存活的对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">将被复制</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">“</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">年老</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.35pt">区</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">Tenu</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ed</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">”</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">。需要注意,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">rv</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">的两个区是对称的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">没先后关系</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">所以同一个区中可能同</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">时存在从</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">E</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">den</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">复制过来对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">和从前一个</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">复制过来的对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">而复制到年老区的只</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">有从第一个</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">Su</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">vo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">去过来的对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">而且</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">Su</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">vo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">r </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">区总有一个是空的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">同时</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">根据程序需</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">要</span><span style="letter-spacing:.55pt">,</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">Su</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">vo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">区是可以配置为多个的(多于两个</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">),</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">这样可以增</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">加对象在年轻代中的存在时</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">间</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">减少被放到</span><span style="letter-spacing:.4pt">年老代的可能</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:112%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.15pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.299pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">年</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.299pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">老代</span><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">:</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.2pt;margin-right:7.65pt;margin-bottom: 0cm;margin-left:1.2pt;margin-bottom:.0001pt;text-indent:-.15pt;line-height: 125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.45pt">在年轻代中经历了</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">N</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">次垃圾回收后仍然存活的对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">就会被放到年老代中</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">因此</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">可以认</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">为年老代中存放的都是一些生命周期较长的对象</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.2pt;text-indent:1.2pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.299pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">持久代</span><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">:</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.3pt;margin-right:2.95pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;line-height:115%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">用于存放静态文件</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">如今</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">ava </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">类</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">方法等</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">持久代对垃圾回收没有显著影响</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">但是有些应</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">用可能动态生成或者调用一些</span><span style="letter-spacing: .15pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">ass</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">例如</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">H</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">be</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">na</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">e&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">等</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">在这种时候需要设置一个比较大的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> 持<span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="text-indent:1.2pt;line-height:13.95pt;mso-line-height-rule: exactly"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">久代空间来存放这些运行过程中新增的类</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">持久代大小通过</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.15pt">-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.25pt">XX</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.15pt">:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">x</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.25pt">Pe</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.25pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">z</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.25pt">e=</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">进</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.4pt">行设置</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:130%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.1pt;line-height:96%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.299pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">注意</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.299pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.3pt;margin-right:2.7pt;margin-bottom: 0cm;margin-left:2.05pt;margin-bottom:.0001pt;text-indent:-1.35pt;line-height: 120%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri">JDK1.8<span style="letter-spacing:.05pt"> </span></span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体">中,永久代已经从</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">java<span style="letter-spacing: .05pt"> </span></span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体">堆中移除,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">String </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">直接存放在堆中,类的元数据存储在 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">meta space </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.3pt">中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">space</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">占用外部内</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">存</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">不占用堆内存</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.15pt;line-height:13.95pt;mso-line-height-rule: exactly"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise: 1.0pt;letter-spacing:.25pt">可以说,在</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp;</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt; mso-text-raise:1.0pt;letter-spacing:.1pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">ava8</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">的新版本中,持久代</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">已经更名为了元空间(</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">a </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">s</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">pa</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">e</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.25pt">)。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:153%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:7.55pt;text-indent:1.45pt;line-height: 97%;mso-outline-level:1"><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.45pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:#4F4F4F;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.25pt;mso-style-textoutline-outlinestyle-linecap: flat;mso-style-textoutline-outlinestyle-join:miter;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">8</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.2pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: #4F4F4F;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">.</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑;color:#4F4F4F;letter-spacing:.25pt"> </span><span style="font-family:宋体; mso-ascii-font-family:微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F; letter-spacing:.75pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: #4F4F4F;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">简述各个版本内存区域的</span><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;letter-spacing: .7pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:#4F4F4F; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .25pt;mso-style-textoutline-outlinestyle-linecap:flat;mso-style-textoutline-outlinestyle-join: miter;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">变化?</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:10.05pt;text-indent:.75pt;line-height: 31.2pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-ascii-font-family: 微软雅黑;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:微软雅黑;mso-bidi-font-family:微软雅黑;color:#4F4F4F;position: relative;top:-6.5pt;mso-text-raise:6.5pt;letter-spacing:.5pt">参考:</span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑;color:#6795B5; position:relative;top:-6.5pt;mso-text-raise:6.5pt;letter-spacing:.35pt"><a href="https://blog.csdn.net/rainnnbow/article/details/50541079"><span style="color: rgb(103, 149, 181);">h</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">tt</span><span style="color: rgb(103, 149, 181);">p</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">s</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">:</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">//</span><span style="color: rgb(103, 149, 181);">b</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">l</span><span style="color: rgb(103, 149, 181);">og</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">.</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">cs</span><span style="color: rgb(103, 149, 181);">dn</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">.</span><span style="color: rgb(103, 149, 181);">n</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.3pt;">e</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">t</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">/</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">r</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.3pt;">a</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">i</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.3pt;">nnnbo</span><span style="color: rgb(103, 149, 181);">w</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">/</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">a</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">rt</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.1pt;">i</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">c</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.1pt;">l</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">e</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">/</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.3pt;">d</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">e</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.15pt;">t</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">a</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.1pt;">il</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.2pt;">s/</span><span style="color: rgb(103, 149, 181); letter-spacing: 0.25pt;">50541079</span></a></span><span lang="EN-US" style="font-family:&quot;微软雅黑&quot;,sans-serif;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:微软雅黑"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:105%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:5.75pt;text-indent:1.25pt;line-height: 93%"><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.3pt">9</span></b><b><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.15pt">.</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">说说各个</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">区域的作用?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:140%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="line-height:140%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.55pt;line-height:13.2pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">1</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.1pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.1pt">、运行时数据区域</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.35pt;margin-right:3.2pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">运行时数据区域包</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">括方法区</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">、</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">虚拟机栈</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">本地方法栈</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">堆</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">程序计数器</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">其中方法区和堆是</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">所</span><span style="letter-spacing:.45pt">有线程共享的数据区</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">其他的是线程隔离的数据区</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.25pt;text-indent:1.55pt;line-height: 13.2pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">1.1 </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt">程序计数器</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.35pt;text-indent:1.05pt;line-height: 95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.4pt">程序计数器是一块较小的内存空间,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">它的作用可以看做是当前线程所执行的字节码的行号指</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection8"> <p class="MsoNormal" style="margin-top:2.75pt;margin-right:3.3pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">示器,确定下一条需要执行的字节码指令。</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">的多线程</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">是通</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">过线程轮流切换并分配处理</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">器执行时间的方式来实现的,在</span><span style="letter-spacing: .35pt">任何确定的一个时刻</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">一个处理器只会执行一条线程中的指</span> <span style="letter-spacing: .5pt">令</span><span style="letter-spacing:.55pt">。</span><span style="letter-spacing:.5pt">为了线程切换之后能恢复到正确的执行位</span><span style="letter-spacing: .3pt"> </span><span style="letter-spacing:.5pt">置</span><span style="letter-spacing: .55pt">,</span><span style="letter-spacing:.5pt">每个线程都需要有一个独立的程</span><span style="letter-spacing:.45pt">序计数</span> <span style="letter-spacing:.55pt">器,各个线程之间的计数器互不影响。如果线程正在执行的是一个</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.1pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">方法</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">则计数器记</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">录的是正在执行的虚拟机字</span><span style="letter-spacing: .25pt"> </span><span style="letter-spacing:.45pt">节码指令的地址,如果正在执行的是</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.25pt">na</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">ti</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">方法</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">则计数器值</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.2pt">为空</span><span style="letter-spacing:.25pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.0pt;text-indent:1.55pt;line-height: 13.95pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">1.2</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.1pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">、</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">java </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">虚拟机栈</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.6pt;margin-right:3.3pt;margin-bottom: 0cm;margin-left:1.0pt;margin-bottom:.0001pt;text-indent:-.55pt;line-height: 124%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.1pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">虚拟机栈也是线程私有的,它的生命</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">周期与线程相同</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">虚拟机栈描述的是</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">方法执行</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.5pt">的内存模型</span><span style="letter-spacing: .55pt">:</span><span style="letter-spacing:.5pt">每个方法被执行的时候都会创建一个栈帧用</span><span style="letter-spacing:.3pt"> </span><span style="letter-spacing:.5pt">于存在局部变量表</span><span style="letter-spacing:.55pt">、</span><span style="letter-spacing:.5pt">操</span><span style="letter-spacing:.45pt">作栈</span><span style="letter-spacing:.55pt">、</span><span style="letter-spacing:.45pt">动</span> <span style="letter-spacing:.4pt">态链接、方法出口等信息。通过所说的栈</span><span style="letter-spacing:.35pt">是局部变量表</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">即与对象内存分配关系最密切的内</span> <span style="letter-spacing: .5pt">存区域</span><span style="letter-spacing:.55pt">。</span><span style="letter-spacing:.5pt">局部变量表的内存空间在编译期</span><span style="letter-spacing: .3pt"> </span><span style="letter-spacing:.5pt">间完成分配</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.5pt">当进入一个方法时</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.5pt">这个方</span><span style="letter-spacing:.45pt">法需要</span> <span style="letter-spacing:.5pt">在帧中分配多</span><span style="letter-spacing:.45pt">大的局部变量空间是确定的</span><span style="letter-spacing: .55pt">,</span><span style="letter-spacing:.45pt">在运行期不会改变</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:12.9pt;margin-right:3.05pt;margin-bottom: 0cm;margin-left:1.0pt;margin-bottom:.0001pt;text-indent:-.55pt;line-height: 124%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.3pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.5pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: 1.0pt">虚拟机栈有两种异常</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: 1.05pt">:</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:1.0pt">如果线</span><span style="letter-spacing:.95pt">程请求的栈深度大于虚拟机所允许的深度</span><span style="letter-spacing:.6pt"> </span><span style="letter-spacing:1.05pt">,</span><span style="letter-spacing:.95pt">则抛弃</span> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">ack</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.4pt">O</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">ve</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">f</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.45pt">w</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">E</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">rr</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">异常</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .65pt">;</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">如果虚拟机栈可以动态扩展的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .65pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">当扩展</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">时无法申请到足够的内存</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">时会抛出</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">O</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">O</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">f</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">oryError </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">异常</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:102%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.55pt;line-height:13.15pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.05pt">1.3 </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt">本地方法栈</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.7pt;margin-right:3.4pt;margin-bottom: 0cm;margin-left:1.95pt;margin-bottom:.0001pt;text-indent:-.8pt;line-height: 126%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.55pt">本地方法栈与虚拟机栈所发挥的作用是相似的,区别在于虚拟</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">机栈为虚拟机执行</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">方法</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">的服务,本地方法栈则是为虚拟机使</span><span style="letter-spacing: .3pt">用到</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">na</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">方法服务</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:13.85pt;text-indent:1.55pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt">1.4<span style="letter-spacing:-.05pt"> </span></span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.65pt">、</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt">java </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt">堆</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.6pt;margin-right:3.4pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:-.6pt;line-height: 120%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.15pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">堆是虚拟机所管理的内</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">存中最大的一块</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">是虚拟机启动是创建的能被所有线程共享的一</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">块内存区域。</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">堆的唯一</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">目的就是存放对象实例,几乎</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">所有的对象实例和数组都</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">在这里</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">分配内存(随着</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">T</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">I </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">编译器的发展</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">在栈上也有可能分配</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">)。</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">堆是垃圾收集器管理的主</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">要区域</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.5pt">在物</span><span style="letter-spacing:.45pt">理上可以使不连续的</span><span style="letter-spacing:.3pt"> </span><span style="letter-spacing:.45pt">内存空间</span><span style="letter-spacing: .55pt">,</span><span style="letter-spacing:.45pt">但在逻辑上是联系的</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:112%"><span style="font-family:宋体; mso-ascii-font-family:Arial;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-hansi-font-family:Arial">如果再堆中没有内存完成实例的分配,并且堆也无法在扩展的时候,将会抛出</span><span style="font-family:宋体;mso-fareast-font-family:微软雅黑;mso-bidi-font-family:宋体; letter-spacing:.55pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">O</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">O</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">f</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">yE</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">异常</span><span lang="EN-US"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.0pt;text-indent:1.55pt;line-height: 13.2pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt">1.5<span style="letter-spacing:-.05pt"> </span></span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:-.7pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt">方法区</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.45pt;margin-right:.6pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;line-height:125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">方法区也是线程共享的内存区域</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">它用于存储已被虚拟机加载</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">的类信息</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">常量</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">静态变量</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">即时</span><span style="letter-spacing:.3pt">编译器编译后的代码等数据</span><span style="letter-spacing:.4pt">。</span><span style="letter-spacing:.3pt">这块区域很少进行垃圾回收</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.3pt">甚</span><span style="letter-spacing:.25pt"> </span><span style="letter-spacing:.3pt">至可以不实现垃圾收集</span><span style="letter-spacing:.4pt">,</span> <span style="letter-spacing:1.1pt">主要是针对常量池</span><span style="letter-spacing:1.05pt">的回收和对类型的卸载</span><span style="letter-spacing: .6pt"> </span><span style="letter-spacing:1.2pt">。</span> <span style="letter-spacing:1.05pt">当方法区无法分配内存的时候</span><span style="letter-spacing: .6pt"> </span><span style="letter-spacing:1.2pt">,</span><span style="letter-spacing:1.05pt">将抛出</span> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">O</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">O</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">f</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.35pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.35pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">yE</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">rr</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">异常</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:11.15pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.05pt;line-height:124%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ss</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">文件中除了有类的版本</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">字段</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">方法</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">接口等描述信息</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">外</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">还有一项信息就是常量池</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.7pt">用于存放编译期的各种字面量和符号引用</span><span style="letter-spacing: .75pt">。</span><span style="letter-spacing:.7pt">并非预置入</span><span style="letter-spacing:.4pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.4pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.35pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">ss</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.7pt">文件中的常量才能进入常量</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">池,运行期间也可能将新的常量放入池中,开发中用的比较多的是</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.15pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">tr</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">ng </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">类的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">ern</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">方法</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.0pt;text-indent:.7pt;line-height:29.3pt; mso-line-height-rule:exactly;vertical-align:middle"><span lang="EN-US"><!--[if gte vml 1]><v:shape id="IM_x0020_10" o:spid="_x0000_i1025" type="#_x0000_t75" style='width:394.2pt; height:29.4pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="file:///C:\Users\SEEHOP~1\AppData\Local\Temp\msohtmlclip1\01\clip_image010.jpg" o:title=""/> </v:shape><![endif]--><!--[if !vml]--><img border="0" width="526" height="39" src="file:///C:/Users/SEEHOP~1/AppData/Local/Temp/msohtmlclip1/01/clip_image010.jpg" v:shapes="IM_x0020_10"><!--[endif]--><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:120%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:4.0pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">假设这句代码出现在方法体中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">那么</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">Ob</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ect</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ob</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">j </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">将会反映到</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">av</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">a </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">栈的局部变量表中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">作为一</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.2pt">个</span><span style="letter-spacing:.15pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">f</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">en</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">类型数据出现</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">new</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Ob</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">ct()</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">将会反</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">映到 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">a </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">堆中</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">形成一块存储了 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">Ob</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">ct</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">类型</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.5pt">的实例数据的结构化内存</span><span style="letter-spacing:.6pt">,</span><span style="letter-spacing:.5pt">此对象类型数据</span><span style="letter-spacing:.6pt">,</span><span style="letter-spacing:.5pt">如对象类型</span><span style="letter-spacing:.6pt">、</span><span style="letter-spacing:.45pt">父类</span><span style="letter-spacing:.6pt">、</span><span style="letter-spacing:.45pt">实现的接口</span><span style="letter-spacing:.6pt">、</span><span style="letter-spacing:.45pt">方法</span><span style="letter-spacing:.35pt"> </span><span style="letter-spacing:.45pt">等信</span> <span style="letter-spacing:.4pt">息存储在</span><span style="letter-spacing:.35pt">方法区</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:131%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:5.0pt;text-indent:1.85pt;line-height:93%"><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">10</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">.</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">J</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">ava</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .456pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">中会存在内存泄漏吗</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .456pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .456pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">简述</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .456pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">一下?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.35pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.15pt;line-height: 122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.45pt">理论上</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">因为有垃圾回收</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">机制(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">C</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">不会存在内存泄露问题(这也是</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">ava</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">被广泛使用于</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">服务器端编程的一个重要</span><span style="letter-spacing:.35pt">原因</span><span style="letter-spacing:.45pt">);</span><span style="letter-spacing:.35pt">然而在实际开发中</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.35pt">可能会存在无用但可达的对象</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.35pt">这些</span> <span style="letter-spacing:.2pt">对象不能被</span><span style="letter-spacing:.15pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">C </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">回收,因此也会导致内存泄露的发生。例如</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">H</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">ibernate</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">的 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">Session</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">(一级缓存</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">中的对象属于持久态,垃圾回收器</span><span style="letter-spacing: .35pt">是不会回收这些对象的</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">然而这些对象中可能存在无用的</span> <span style="letter-spacing: .4pt">垃圾对象</span><span style="letter-spacing:.45pt">,</span><span style="letter-spacing:.4pt">如果不及时关闭(</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">se</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">或清空(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">f</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">s</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">h</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">)</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">一级缓存就可能导致内存泄露</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:112%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:5.05pt;text-indent:1.85pt;line-height: 93%"><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.2pt">11</span></b><b><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.15pt">.</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">a</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">va</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.456pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">类加载过程?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:7.2pt;text-indent:1.05pt;line-height:94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">在</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">中,类装载器把一个类装入</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">虚拟机中,要经过三个步骤来</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">完成</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">:</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">装载</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">链接和</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.35pt;text-indent:1.05pt;line-height: 15.6pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.5pt">初始化</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.5pt">其中链</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.45pt">接又可以分成校验</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.55pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.45pt">准备</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.55pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.45pt">解析</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.1pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">装载</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">:</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">查找和导入类或接口的二</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">进制数据</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">;</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.05pt;line-height: 15.6pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.5pt">链接</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.55pt">:</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.5pt">执行下</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.45pt">面的校验</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.55pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.45pt">准备和解析步骤</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.45pt">其中解析步骤是可以选择的</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.55pt">;</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.15pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">校验</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">:</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">检查导入类或接口的二进制数据的正确</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">性</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">;</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.15pt;line-height: 15.6pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.45pt">准备</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.5pt">:</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.45pt">给类的静态变量分配并初始化</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-3.5pt;mso-text-raise:3.5pt; letter-spacing:.4pt">存储空间</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-3.5pt;mso-text-raise:3.5pt;letter-spacing:.5pt">;</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.05pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">解析</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">:</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">将符号引</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">用转成直接引用</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">;</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.05pt;line-height: 91%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.45pt">初始化</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">:</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">激活类的静态变量</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.15pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">初始化</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">ava</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">代码和静态</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">ava</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">代码块</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:136%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:5.05pt;text-indent:1.85pt;line-height: 22.15pt;mso-line-height-rule:exactly"><b><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt; mso-text-raise:1.0pt;letter-spacing:.15pt">12</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">.</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .456pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">什么是</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp;</span><b><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt; mso-text-raise:1.0pt;letter-spacing:.2pt">G</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">C?</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt; mso-style-textoutline-type:solid;mso-style-textoutline-fill-color:black; mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .456pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">为什么要有</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp;</span><b><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt; mso-text-raise:1.0pt;letter-spacing:.15pt">G</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">C</span></b><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .456pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:158%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.15pt;line-height:95%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">是垃圾收</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">集的意思</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">内存处理是编程人员容易出现问题的地方</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:3.75pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.2pt;line-height:120%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">忘记或者错误的内</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">存回收会导致程序或系统的不稳定甚至崩溃</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ava </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">提供的</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">功能可以自</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">动监测对象是否超过作用域从而达到自动回收内存的目的,</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">av</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">语言没有提供释放已分配内</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">存的显示操作方法。</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">程序员不用担心内存管理,因为垃圾收</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">集器会自动进行管理</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">要请</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">求垃圾收集,可以调用下面的方法之一:</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">Sys</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">.</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">gc</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">()</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">或</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Ru</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">ti</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">.</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">ge</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">Run</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">ti</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">().</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">gc</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">但</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">V</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">可</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">以屏蔽掉显示的垃圾</span><span style="letter-spacing:.4pt">回收调用</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:15.1pt;margin-right:4.85pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.05pt;line-height:122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">垃圾回收可以有效的防止内</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">存泄露</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">有效的使用可以使用的内存</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">垃圾回收器通常是作为一</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">个单独的低优先级的线程运行,不</span><span style="letter-spacing: .35pt">可预知的情况下对内存堆中已经死亡的或者长时间没有使</span> <span style="letter-spacing:.4pt">用的对象进行清除和回收,程序员</span><span style="letter-spacing:.35pt">不能实时的调用垃圾回收器对某个对象或所有对象进行垃</span> <span style="letter-spacing:.25pt">圾回收</span><span style="letter-spacing:.3pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.2pt;text-indent:1.05pt;line-height: 95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.45pt">在</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ava</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">诞生初期</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">垃圾回收是</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">最大的亮点之一</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">因为服务器端的编程需要有效的</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">防止</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection9"> <p class="MsoNormal" style="margin-top:3.0pt;margin-right:2.45pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:1.15pt;line-height: 122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.5pt">内存泄露问题,然而时过境迁,如今</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">的垃圾回</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">收机制已经成为被诟病的东西</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">移动智</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">能终端用户通常觉得</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">O</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">的系统比</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">A</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">nd</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">d</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">系统有更好的用户体验</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">其中一个深层次的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">原因</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">就在于</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">And</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">d</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">系</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">统中垃圾回收的不可预知性</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.75pt;margin-right:2.45pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:-.1pt;line-height: 125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.35pt">采用</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">“</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">分代式垃圾收集</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">”</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">这种方法会跟</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">ava</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">对象的生命周期将堆内存划分为不同的区域</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">在</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">垃圾收集过程中</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">可能会将对象移动到不同区</span><span style="letter-spacing: .4pt">域</span><span style="letter-spacing:.5pt">:</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:12.45pt;margin-right:2.6pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:120%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">伊甸园(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">E</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">d</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">):</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">这是对象最初诞生的区域</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">并且对大多数对象来说</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">这里是它们唯</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">一存在</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">过的区域</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="text-indent:1.15pt;line-height:13.95pt;mso-line-height-rule: exactly"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt;letter-spacing:.45pt">幸存者乐园(</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-.5pt; mso-text-raise:.5pt;letter-spacing:.25pt">Su</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">rv</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">r</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.55pt">)</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">:</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">从伊甸园幸存下来的对象会被挪到这里</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:1.55pt;margin-right:2.35pt;margin-bottom: 0cm;margin-left:1.25pt;margin-bottom:.0001pt;line-height:124%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">终身颐养园(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">Te</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">nu</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">d</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">:</span><span style="letter-spacing:.4pt">这是足够老的幸存对象的归宿</span><span style="letter-spacing:.45pt">。</span><span style="letter-spacing:.4pt">年轻代收集(</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">no</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">GC</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">过程是</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">不会触及这个地方的。当</span><span style="letter-spacing:.35pt">年轻代收集不能把对象放进终身颐养园时</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">就会触发一次完全收集</span> <span style="letter-spacing:.3pt">(</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">GC</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">这里可能还会牵扯到压缩</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">以便为大对象腾出足够的空间</span><span style="letter-spacing: .35pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:.05pt;text-indent:1.3pt;line-height:94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">与垃圾回收相</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">关的</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">V</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">参数</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.45pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.15pt">· -</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.25pt">X</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">s</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.15pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">/</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp;-</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt; mso-text-raise:1.0pt;letter-spacing:.25pt">X</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.4pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">x</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp;</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-1.0pt; mso-text-raise:1.0pt;letter-spacing:.45pt">—</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">堆的初始大小</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.25pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">/</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.45pt">堆的最</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">大大小</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:130%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.45pt;line-height: 31.2pt;mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.15pt">· -</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.25pt">X</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.4pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.25pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.15pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.4pt">—</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.45pt">堆中年轻</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.4pt">代的大小</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.05pt;text-indent:1.1pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">补</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.1pt">充</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:.7pt;line-height:13.95pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.1pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.1pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">是由</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">&nbsp;</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;position:relative;top:-.5pt; mso-text-raise:.5pt;letter-spacing:.15pt">C+</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">+</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.15pt">发展来的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.3pt;line-height:14.0pt; mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.3pt">它摈弃了</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.2pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">++</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.3pt">中一些繁琐容易出错的东西。其中有一条</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">就是这个</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.15pt">GC</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.3pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.3pt;line-height:122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">写</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">/</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">C++</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">程序,程序员定义了一个变量,就是在内存中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">开辟了一段相应的空间来存值</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">内存</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.2pt">再大也是有限的,所以当程序不再需要使用某个变量的时候,</span><span style="letter-spacing:.15pt">就需要释放这个内存空间资源</span><span style="letter-spacing: .2pt">,</span> <span style="letter-spacing:.45pt">好让别的变量来用它</span><span style="letter-spacing:.5pt">。</span><span style="letter-spacing:.45pt">在</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.25pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">/</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">C++</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">中</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">释放无用变量内存空间的事情要由程序员自</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">己来解决</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">就是说当程序员认为变量没用了,就应</span><span style="letter-spacing: .35pt">当写一条代码</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">释放它占用的内存</span><span style="letter-spacing:.4pt">。</span><span style="letter-spacing:.35pt">这样才能最大程</span> <span style="letter-spacing:.45pt">度地避免内存泄露和</span><span style="letter-spacing:.4pt">资源浪费</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:101%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:2.6pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:-.05pt;line-height: 122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.4pt">但是这样显然是非常繁琐的。程序比</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">较大</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">变量多的时候往往程序员就忘记释放内存或者在</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">不该释放的时候释放内存了。而且释</span><span style="letter-spacing: .35pt">放内存这种事情</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">从开发角度说</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">不应当是程序员所应</span> <span style="letter-spacing:.4pt">当关注的。程序员所要做的应该</span><span style="letter-spacing:.35pt">是实现所需要的程序功能</span><span style="letter-spacing: .4pt">,</span><span style="letter-spacing:.35pt">而不是耗费大量精力在内存的分</span> <span style="letter-spacing:.35pt">配</span><span style="letter-spacing:.3pt">释放上</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.25pt;margin-right:2.35pt;margin-bottom: 0cm;margin-left:1.0pt;margin-bottom:.0001pt;text-indent:-.3pt;line-height:124%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">有了</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,就不需要程序员</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">去人工释放内存空间</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">当</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">ava</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">虚拟机发觉内存资源紧张的时</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.6pt">候</span><span style="letter-spacing:.65pt">,</span><span style="letter-spacing:.6pt">就会自动地去清理无用</span><span style="letter-spacing:.55pt">变量所占用的内存空间</span><span style="letter-spacing:.65pt">。</span><span style="letter-spacing:.55pt">当然</span><span style="letter-spacing:.65pt">,</span><span style="letter-spacing:.55pt">如果需要</span><span style="letter-spacing:.65pt">,</span><span style="letter-spacing:.55pt">程序员可以在</span><span style="letter-spacing:.4pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">程序中显式地使用</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Sy</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">st</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">.</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">gc</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">来强制进行一次立即的内存清理</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:12.2pt;margin-right:2.0pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:.7pt;line-height:122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">因为显式声明是做堆内存全扫描,也就是</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">F</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">ll </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">GC</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">,是需要</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.15pt">停止所有的活动的(</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.05pt">St</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">op </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">T</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">h</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">W</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">rl</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">d</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"> <span style="letter-spacing:.15pt">Co</span><span style="letter-spacing:.1pt">ll</span><span style="letter-spacing:.15pt">ec</span><span style="letter-spacing:.1pt">ti</span><span style="letter-spacing:.15pt">on</span><span style="letter-spacing:.1pt"> </span></span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">),你的应用能</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">承受这个吗?而其显示调用</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">Sys</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">.</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">gc</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">()</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">只是给虚拟机一个建议</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">不</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">一定会执行</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">因为</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">Sy</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">st</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">.</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">g</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">c()</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">在一个优先级很低的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">线程中执行</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection10"> <p class="MsoNormal" style="margin-top:6.95pt;text-indent:2.0pt;line-height:93%"><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">13</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">.</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">简述一下</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">J</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">a</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">v</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">a</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">垃圾回收机制?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:6.05pt;margin-right:2.7pt;margin-bottom: 0cm;margin-left:1.35pt;margin-bottom:.0001pt;text-indent:.1pt;line-height:123%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">什么是垃圾回收机制:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">**</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">在系统运行过程中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">会产生一些无用的对象</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">这些对象占据着一</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">定的内存,如果不对这些</span><span style="letter-spacing:.35pt">对象清理回收无用对象的内存</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">可能会导致内存的耗尽</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">所以垃圾</span> <span style="letter-spacing:.4pt">回收机制回收的是内存。同时</span><span style="letter-spacing: .2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">回收的是堆区和方法区的内存</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:12.5pt;margin-right:1.95pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:-.4pt;line-height:122%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">V</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.45pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">回收特点</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">st</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">op</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">-t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">h</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">w</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">d</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">当要进行垃圾回收时候</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">不管何种</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">GC</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">除了垃圾回收</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.7pt">的线程</span><span style="letter-spacing:.65pt">之外其他任何线程都将停止运行</span><span style="letter-spacing:.75pt">。</span><span style="letter-spacing:.65pt">被中断的任务将会在垃圾回收完成后恢复进行</span><span style="letter-spacing:.75pt">。</span> </span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.15pt">GC</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">不同算法或是</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">GC</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">调优就是减少</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">st</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">op</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">-t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">h</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">e-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">wo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">rl</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">d </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">的时间</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">。</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">à(</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">为何非要 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">st</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">op</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">-t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">h</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">e-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">wo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">rl</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">d</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">)</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">就像</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">是一个同学的聚会,地上有很多垃</span><span style="letter-spacing: .35pt">圾</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">你去打扫</span><span style="letter-spacing:.4pt">,</span><span style="letter-spacing:.35pt">边打扫边丢垃圾怎么都不可能打扫干净的</span> <span style="letter-spacing: .25pt">哈。当在垃圾回收时候不暂停所有的程序,在垃圾回收时候有</span><span style="letter-spacing:.15pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">ne</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">w</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">一个</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">新的对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">B</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.2pt">此时对</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">象</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">A</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">是可达</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">B</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">的,但是没有来及标记就把</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">B</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">当成无用的对象给清理掉了,这就会导致程序</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">的运行会出现错</span><span style="letter-spacing:.35pt">误</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:15.0pt;text-indent:1.25pt;line-height: 95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.45pt">如何判断</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">哪些对象需要回收呢</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:2.55pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.4pt;line-height:125%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">引用计数算法(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">j</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">中不是使用此方法</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">):</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">每个对象中添加一个引用计数器</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">当</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">有别人</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.25pt">引用它的时候</span><span style="letter-spacing:.3pt">,</span><span style="letter-spacing:.25pt">计数器就会加</span><span style="letter-spacing:.15pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">1</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">当别人不引用它的时候</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">计数器就会减</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">1 </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.2pt">当计数器为</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">0</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">的时候对象就可以当成垃圾。算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">简单</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">但是最大问题就是在循环引用的时候不能够正确把</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">对象</span><span style="letter-spacing:.35pt">当成垃圾</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.85pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.4pt;line-height:123%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">根搜索方法(这是后面垃圾搜集算法的基</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">础</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">:</span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.15pt">**</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">这是</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">V</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">一般使用的算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">设立若干</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">了根对象</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">当上述若干个跟对象对某一个对象都不可达的时候</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">这个对</span><span style="letter-spacing:.4pt">象就是无用的对象</span><span style="letter-spacing:.5pt">。</span> <span style="letter-spacing:.45pt">对象所占的</span><span style="letter-spacing: .4pt">内存可以回收</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.2pt;margin-right:2.85pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">根搜索算法的基础上</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.6pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">现代虚拟机的实现当中</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.6pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">垃圾搜集的算法主要有三种</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">分别是标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">清除算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">、</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">复制算法</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">、</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">-</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">整理算法</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.15pt;margin-right:2.75pt;margin-bottom: 0cm;margin-left:1.3pt;margin-bottom:.0001pt;text-indent:.15pt;line-height:125%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">-</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">消除算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">当堆中的有效内存被耗尽的时候</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">就会停止整个系统</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">就会调用标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">消除算法</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">主</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">要做两件事</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">1</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">就是标记</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">2</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">就是清除</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">然后让程序恢复</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:12.5pt;text-indent:1.15pt;line-height: 32.95pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.35pt">标记</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.45pt">:</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.35pt">遍历所有</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.25pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.25pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.2pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.2pt">oo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.15pt">ts </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.35pt">把可达的对象标记为存活的对象</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.4pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:.05pt;text-indent:1.1pt;line-height:94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">清除</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">:</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">把未标记为存活的对象清</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">楚掉</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.1pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">缺</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.1pt">点</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.15pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.35pt">就是效率相对比较低</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">。</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.35pt">会导致</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">st</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">op</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">-t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">he</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.25pt">w</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.05pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.15pt">d</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">&nbsp;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">时间过长</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.4pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:2.8pt;margin-bottom: 0cm;margin-left:.7pt;margin-bottom:.0001pt;text-indent:1.15pt;line-height:125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.75pt">因为无用的对象内存不是连续的因此清理后</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.7pt">的内存也不是连续的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.75pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">(</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .7pt">会产生内存碎片</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.7pt">因此</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">V</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.35pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">还要维持一个空闲列表,增加一笔开销,同时在以后内存使用时</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">候</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">去查找可用的内存</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">这个效率也是很</span><span style="letter-spacing:.4pt">低的</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:13.3pt;text-indent:1.35pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">复制算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.35pt">:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.1pt">(</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">这个算法一般适合在新生代</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.2pt">&nbsp;</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.2pt">GC</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.1pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.35pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">将原有的内存分为两块</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.35pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-1.0pt;mso-text-raise:1.0pt;letter-spacing:.3pt">每次只</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-1.0pt;mso-text-raise:1.0pt; letter-spacing:.25pt">适用其中的一</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><div class="WordSection11"> <p class="MsoNormal" style="margin-top:2.85pt;margin-right:2.35pt;margin-bottom: 0cm;margin-left:1.0pt;margin-bottom:.0001pt;text-indent:.05pt;line-height:126%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">块,在垃圾回收的时候,将一块正在使用的内存中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">存活</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">(</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">上述根搜索的算法</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">的对象复制到另</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.55pt">一块没有使用的内存中</span><span style="letter-spacing:.65pt">,</span><span style="letter-spacing:.55pt">原来的那一块全部清除</span><span style="letter-spacing:.65pt">。</span><span style="letter-spacing:.55pt">与上述的标记</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">-</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">清除算法相比效率更高</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">但是不太适合使用</span><span style="letter-spacing:.45pt">在对象存活较多的情况下</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">(</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">如老年代</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.7pt;margin-right:2.35pt;margin-bottom: 0cm;margin-left:1.65pt;margin-bottom:.0001pt;text-indent:-.15pt;line-height: 125%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">缺</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">点</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">**</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">每次对整个半区内存回收</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">因此效率比上面的要高点</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">同时在分配内存的时候不</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">需要考虑内存的碎片</span><span style="letter-spacing:.5pt">。</span><span style="letter-spacing:.45pt">按照顺</span><span style="letter-spacing:.4pt">序分配内存</span><span style="letter-spacing:.5pt">。</span><span style="letter-spacing:.4pt">简单高效</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.2pt;margin-right:2.45pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:-.1pt;line-height:125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">但是最大的问题在于此算法在对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">存活率非常低的时候使用</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">将可用内存分为两份</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">每次只</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">使用一份这样极大</span><span style="letter-spacing:.4pt">浪费了内存</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:14.2pt;text-indent:1.1pt;line-height:96%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">注意(重要):现在的虚拟机使用复制</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">算法来进行新生代的内存回收</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">因为在新生代中绝大</span><span lang="EN-US" style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:2.95pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.5pt;line-height:119%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">多数的对象都是</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">“</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">朝生夕亡</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">”</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">所以不需要将整个内存分为两个部分</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">而</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">是分为三个部分</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">一</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.15pt">块为</span><span style="letter-spacing:.1pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">Eden </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">和两块较小的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">Survivor </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">空间</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">(</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">比例</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">-&gt;8:1:1)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.15pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.1pt">每次使用 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">Eden</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.1pt">和其中的一块 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">Survivor</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">垃圾回收时候将上述两块中存活的对象复制到另外一</span><span style="letter-spacing:.35pt">块</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">Su</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">vo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">上</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">同时清理上述</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Eden</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">和</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">rv</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">。所以每次新生代就可以使用</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">90</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">%</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">的内存。只有</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">10</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">%</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">的内存是浪费的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">。</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">(</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">不能保证每</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">次新生代都少于</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">10</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">%</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">的对象存活</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">当在垃圾回收复制时候如果一块</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">rv</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">不够时候</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.25pt">需要</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">老年代来分担,大对</span><span style="letter-spacing:.45pt">象直接进入老年代</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.2pt;margin-right:2.35pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;line-height:126%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">-</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">整理算法:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">(</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">老年代</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">在存活率较高的情况下,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">复制的算法效率相对比较低</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">同时还</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">要考虑存活率可能为</span><span style="letter-spacing:.25pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">100</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">%</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">的极端情况</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">因此又不能把内存分为两部分的复</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">制算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:102%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;margin-right:2.1pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:-.05pt;line-height: 119%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.75pt">在上面标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.75pt">复制算法的基础之上</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.8pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.75pt">演变出了一个新的算法就是标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.75pt">整理算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt"> </span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.8pt">。</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .75pt">首先从</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">oo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">ts</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">开始标记所有可达的对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">标记为存活的对象</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">然后将存活的对象压缩</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">到内存一端</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">按照内存地址的次序依次排</span><span style="letter-spacing: .45pt">列</span><span style="letter-spacing:.5pt">,</span><span style="letter-spacing:.45pt">然后末端内存地址之后的所有内存都清除</span><span style="letter-spacing: .5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:104%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;margin-right:2.2pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.4pt;line-height:125%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">总结:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">**</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">将标记存活的对象</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">按照内存地址顺序排列到内存另一端</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">末端内存地址之后的内</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.4pt">存都</span><span style="letter-spacing: .35pt">会被清除</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="margin-top:12.5pt;margin-right:2.35pt;margin-bottom: 0cm;margin-left:1.4pt;margin-bottom:.0001pt;text-indent:.05pt;line-height:125%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">*</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">*</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">比较</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">相比较于标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">-</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">清楚算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">(</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">传统的</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">该算法可以解决内存碎片问题同时还可以解</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">决复制算法</span><span style="letter-spacing:.45pt">部分内存不能利用的问题</span><span style="letter-spacing:.55pt">。</span><span style="letter-spacing:.45pt">但是标记</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">-</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">整理算法的效率也不是很高</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-top:14.05pt;margin-right:2.45pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:-.05pt;line-height: 125%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.15pt">-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">&gt;</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">上述算法都是根据根节点搜索算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">来判断一个对象是不是需要回收</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">而支撑根节点搜索算</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">法能够正常工作理</span><span style="letter-spacing:.45pt">论依据就是语法中变量作用域的相关内容</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height:104%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.1pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">三种算法比</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">较</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.4pt">:</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.5pt;line-height:31.2pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-14.5pt;mso-text-raise:14.5pt; letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.45pt">效率:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-14.5pt;mso-text-raise:14.5pt; letter-spacing:.45pt">复制算法</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-14.5pt;mso-text-raise:14.5pt; letter-spacing:.25pt">&gt;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.45pt">标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.15pt">-</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-14.5pt;mso-text-raise:14.5pt; letter-spacing:.45pt">整理</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.4pt">算法</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.2pt">&gt;</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-14.5pt;mso-text-raise:14.5pt; letter-spacing:.4pt">标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-14.5pt;mso-text-raise:14.5pt; letter-spacing:.1pt">-</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-14.5pt;mso-text-raise:14.5pt;letter-spacing:.4pt">清除算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-14.5pt;mso-text-raise:14.5pt; letter-spacing:.45pt">;</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="text-indent:1.5pt;line-height:14.0pt;mso-line-height-rule: exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.5pt">内存整齐度:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">复</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">制算法</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">=</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">-</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">整理算法</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">&gt;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">-</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">清除算法</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.5pt;line-height:13.95pt; mso-line-height-rule:exactly"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.5pt">内存利用率:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.5pt">标</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">-</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">整理算法</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">=</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt;letter-spacing:.1pt">-</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.45pt">清除算法</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt; letter-spacing:.2pt">&gt;</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt;letter-spacing:.45pt">复制算法</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p> <p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p> <p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.2pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">分代收集</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">算法</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">:</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p> </div><p> <span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-ansi-language: EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;mso-no-proof:yes"><br clear="all" style="page-break-before:always;mso-break-type:section-break"> </span> </p><p class="MsoNormal" style="margin-top:3.0pt;margin-right:4.0pt;margin-bottom: 0cm;margin-left:2.3pt;margin-bottom:.0001pt;text-indent:-1.15pt;line-height: 120%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.55pt">现</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">在使用的</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">虚拟机并不是只是使用一种内存回收机制</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.6pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">而是分代收集的算法</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .6pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">就是将</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">内存根据对象存活的周期划分为几块</span><span style="letter-spacing: .4pt">。</span><span style="letter-spacing:.35pt">一般是把堆分为新生代</span><span style="letter-spacing:.4pt">、</span><span style="letter-spacing:.35pt">和</span><span style="letter-spacing:.3pt">老年代</span><span style="letter-spacing:.4pt">。</span><span style="letter-spacing:.3pt">短命对象存放在</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="text-indent:1.15pt;line-height:31.15pt;mso-line-height-rule: exactly"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise: 16.0pt;letter-spacing:.45pt">新生代中</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.45pt">长命</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.4pt">对象放在老年代中</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.55pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p><p class="MsoNormal" style="text-indent:1.05pt;line-height:94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">对于不同的代</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">采用</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">不同的收集算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.25pt;margin-right:22.3pt;margin-bottom: 0cm;margin-left:1.5pt;margin-bottom:.0001pt;line-height:233%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">新生代:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">由于存活的对象相对比较</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">少</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">因此可以采用复制算法该算法效率比较快</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">老年代:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">**</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">由于存活的对象比较多</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">哈</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">可以采用标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">-</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">清除算法或是标记</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">-</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">整理算法</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:.2pt;margin-right:3.4pt;margin-bottom: 0cm;margin-left:1.55pt;margin-bottom:.0001pt;line-height:122%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.6pt">(注意)新生态由于根据统</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">计可能有</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">98</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.35pt">%</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">对象存活时间很短因此将内存分为一块比较大的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">Eden</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">空间和两块较小的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">rv</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">空间,每次使</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">用</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">Eden</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">和其中一块</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">rv</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">当回收时</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">将</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">Eden</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">和</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">中还存活着的对象一次性地复</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">制到另外一块</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">空间上</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">最后清理掉</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">Eden</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">和刚才用过的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">Su</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">ivo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">空间</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:102%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.15pt;line-height: 31.2pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.5pt">上述是垃圾回</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.45pt">收机制的算法</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt; letter-spacing:.45pt">但是垃圾回收器才是垃圾回收的具体实现</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-16.0pt;mso-text-raise:16.0pt;letter-spacing:.55pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:.05pt;text-indent:1.35pt;line-height:94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">常见有五个垃</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">圾回收器</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">:</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:114%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.3pt;text-indent:1.25pt;line-height:13.95pt; mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt">一<span style="letter-spacing:-.05pt">:</span>串行收集器:<span lang="EN-US" style="letter-spacing:-1.6pt">&nbsp; </span>(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt">Serial </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise: .5pt">收集器)</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.3pt;margin-right:.6pt;margin-bottom: 0cm;margin-left:1.9pt;margin-bottom:.0001pt;text-indent:-.65pt;line-height: 126%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.25pt">该收集器最古老、稳定简单是一个单线程的收集器,</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">(</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">s</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">op</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">-t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">he</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.05pt">-</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">w</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">rl</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">d</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">可能会产生长时间</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">的停顿</span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.1pt">. </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">ser</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">l&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt">收集器一定不能用于服务器端</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">。</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">这个收集器类型仅应用于</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">单核</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">CPU</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">桌面电脑</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:13.85pt;margin-right:.45pt;margin-bottom: 0cm;margin-left:1.25pt;margin-bottom:.0001pt;text-indent:-.1pt;line-height: 125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">新生代和老年代都会使用<span style="letter-spacing: -.05pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri">seria l </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体">收集器<span style="letter-spacing:-.95pt">。</span>新生代使用复制算法(内存分三块的那个复制算法<span style="letter-spacing:-.95pt">)。</span> <span style="letter-spacing:.45pt">老</span><span style="letter-spacing:.4pt">年代使用标记</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">-</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">整理算法</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:14.1pt;text-indent:1.25pt;line-height: 14.0pt;mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt">二:并行收集器:<span lang="EN-US" style="letter-spacing: -1.6pt">&nbsp; </span>(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; position:relative;top:-.5pt;mso-text-raise:.5pt">Parallel </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;position:relative;top:-.5pt;mso-text-raise:.5pt">收集器)</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.25pt;margin-right:3.55pt;margin-bottom: 0cm;margin-left:1.45pt;margin-bottom:.0001pt;line-height:125%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">parallel </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">收集器使用多线程并行处理</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">GC</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">,因</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.1pt">此更快</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .1pt">当有足够大的内存和大量芯数时</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">,</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">parallel</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.55pt">收集器是有用的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.6pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">它也被称为</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">“</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">吞吐量优先垃圾</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">收集器</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.6pt">。</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">”</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:14.1pt;text-indent:1.1pt;line-height:13.95pt; mso-line-height-rule:exactly"><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;position:relative; top:-.5pt;mso-text-raise:.5pt">三<span style="letter-spacing:-.05pt">:</span>并行收集器:<span lang="EN-US" style="letter-spacing:-.4pt">&nbsp; </span>(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;position:relative;top:-.5pt;mso-text-raise:.5pt">Parallel Old&nbsp; </span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;position:relative;top:-.5pt;mso-text-raise:.5pt">垃圾收集器)</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.3pt;margin-right:3.4pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:123%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">相比</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">于</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">pa</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">ll</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">收集器</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">他们的唯一区别就是在老年代所执行的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">算法的不同</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">它执行三</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">个步骤</span><span style="letter-spacing:.45pt">:</span><span style="letter-spacing:.4pt">标记</span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.15pt">-</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">汇总</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">-</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">压缩(</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">k</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">–</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">s</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.35pt">mm</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">y</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">–</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">o</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">m</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">p</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">ac</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">on</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">)。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">汇总步骤与</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">清理的不同之处在</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.55pt">于,其将依然幸存的对象分发到</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">预先处理好的不同区</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">域</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">算法相对清理来说略微复杂一</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> 点<span style="letter-spacing:.05pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="line-height:101%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.25pt;text-indent:2.05pt;line-height: 95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">四<span style="letter-spacing:-.05pt">:</span>并行收集器<span style="letter-spacing:-.05pt">:</span><span lang="EN-US" style="letter-spacing: -2.05pt">&nbsp; </span>(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">CMS </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体">收集器)<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.3pt;margin-right:0cm;margin-bottom:0cm; margin-left:1.1pt;margin-bottom:.0001pt;text-indent:.5pt;line-height:121%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">Con</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">u</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">rre</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ark</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">w</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">ee</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">p</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">:</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">并发标记清除</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">是一</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">种以获取最短回收停顿时间为目标的收集器</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">适合应用在互联网站或者</span><span style="letter-spacing: .2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">B</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">/</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">系统的服务器上</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">这类应用尤其重视服务</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">器的响应速度</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">希望</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">系统停顿时间最短</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="line-height:127%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.25pt;line-height: 95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.4pt">五</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">:</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">1 </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">收集器</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.25pt;margin-right:2.45pt;margin-bottom: 0cm;margin-left:1.2pt;margin-bottom:.0001pt;text-indent:-.05pt;line-height: 125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.5pt">这个类型的垃圾收集算法是为了替代</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.4pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">收集</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">器而被创建的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">因为</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">S</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">收集器在长时间</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">持续运行时</span><span style="letter-spacing:.4pt">会产生很多问题</span><span style="letter-spacing:.45pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="line-height:103%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:5.7pt;text-indent:2.0pt;line-height:93%"><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">14</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">.</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">如何判断一个</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">对象是否存活?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:5.9pt;margin-right:2.6pt;margin-bottom: 0cm;margin-left:1.3pt;margin-bottom:.0001pt;text-indent:-.25pt;line-height: 125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.55pt">在堆里面存放</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">着</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">世界中几乎所有的对象实例</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.6pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">垃圾收集器对堆内存进行回收前</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.6pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">都会</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">先</span><span style="letter-spacing:.35pt">判断这些</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top:12.45pt;margin-right:2.6pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;line-height:125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">对象之中哪些还</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">“</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">存活</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">”</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">着</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">哪些已经</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">“</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">死去</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">”</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">(</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">即不可能在被任何途径使用的对象</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">一共有两</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.25pt">种算</span><span style="letter-spacing:.2pt">法</span><span style="letter-spacing:.3pt">:</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="line-height:103%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.25pt;text-indent:1.85pt;line-height: 95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.3pt">引用计数</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.25pt">算法</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:3.25pt;margin-right:0cm;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;line-height:125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">给对象中添加一个引用计数器,每当有一个地方引用</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.15pt">它时</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.2pt">,</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">计数器值就加 </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.05pt">1</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">;</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.15pt">当引用失效时</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">计数</span><span style="letter-spacing:.3pt">器</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top:14.2pt;text-indent:1.1pt;line-height:95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt">值就减</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">1</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">;</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">任何时刻计数器为</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">0</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt">的对象就是不可能再</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .15pt">被使用的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.25pt;margin-right:2.7pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:-.45pt;line-height: 125%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">V</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">里面并没有选用引用计数算法来管理内存,主要原因是它很难解决</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">对象之间相互循环引</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">用的问题</span><span style="letter-spacing:.35pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top:14.15pt;text-indent:1.15pt;line-height: 95%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.45pt">可达性</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">分析算法</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:1.5pt;margin-right:2.6pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:-.05pt;line-height: 125%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:.5pt">通过一系列的称为</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">“</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.35pt">G</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">Roo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">ts</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">”</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">的对象作为起始点</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">从这些</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">节点开始向下搜索</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">搜索所走过的</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">路径称</span><span style="letter-spacing:.3pt">为</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top:14.05pt;margin-right:2.1pt;margin-bottom: 0cm;margin-left:1.25pt;margin-bottom:.0001pt;text-indent:.6pt;line-height:126%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">引用链</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">R</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">f</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">r</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">e</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">ce</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">Ch</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">n</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .4pt">,当一个对象到</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">GC</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">R</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">oo</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">t</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">s</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">没有任何引用链相连时</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">则证明此对象是</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.3pt">不</span><span style="letter-spacing:.25pt">可用的</span><span style="letter-spacing:.4pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="line-height:115%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:5.7pt;text-indent:2.0pt;line-height:93%"><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">15</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">.</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">垃圾回收的优点和原理,并考</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">虑</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.2pt"> </span><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">2</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.3pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .515pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">种回收机制?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:10.0pt;text-indent:1.4pt;line-height:93%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">基</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">本原理是什么?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:4.05pt;margin-right:2.6pt;margin-bottom: 0cm;margin-left:1.1pt;margin-bottom:.0001pt;text-indent:-.4pt;line-height:123%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">语言中一个显著的特点就是引入了垃圾回收机制,使</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">++</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">程序员最头疼的内存管理</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.3pt"> </span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">的</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.35pt">问题迎刃而解,它使得</span><span style="letter-spacing:.2pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">v</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">a</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">程序员在</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">编写程序的时候不再需要考虑内存管理</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">由于</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .2pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt">有个垃</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">圾回收机制,</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">J</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ava</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">中的对象不再有</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">"</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">作用域</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">"</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">的概念,只有对象的引用才有</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">"</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .5pt">作</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">用</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">域</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">" </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">垃圾</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">回收可以有效的防止内存泄露</span><span style="letter-spacing: .55pt">,</span><span style="letter-spacing:.5pt">有效的使用可以使用的内存</span><span style="letter-spacing:.55pt">。</span><span style="letter-spacing:.5pt">垃圾回收器通</span><span style="letter-spacing:.3pt"> </span><span style="letter-spacing:.5pt">常是作</span><span style="letter-spacing:.45pt">为一个</span> <span style="letter-spacing:.5pt">单独的低级别的线程运行</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.5pt">不可预知的情况下对内存堆中已经死亡的或</span><span style="letter-spacing:.3pt"> </span><span style="letter-spacing:.5pt">者长时间没有</span><span style="letter-spacing:.45pt">使用</span> <span style="letter-spacing:.5pt">的对象进行清楚和回收</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.5pt">程序员不能实时的调用垃圾回收器对某个</span><span style="letter-spacing:.3pt"> </span><span style="letter-spacing:.5pt">对象或所有对象进行垃</span> <span style="letter-spacing:.5pt">圾回收</span><span style="letter-spacing:.55pt">。</span><span style="letter-spacing:.5pt">回收机</span><span style="letter-spacing:.45pt">制有分代复制垃圾回收和标记垃圾回收</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.45pt">增量</span><span style="letter-spacing:.3pt"> </span><span style="letter-spacing:.45pt">垃圾回收</span><span style="letter-spacing:.55pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top:3.0pt;margin-right:.65pt;margin-bottom: 0cm;margin-left:1.15pt;margin-bottom:.0001pt;text-indent:.1pt;line-height:120%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">浅拷贝被复制对象的所有</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">变量都含有与原来的对象相同的值</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">而所有的对其他对象的引用仍</span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.7pt">然指向原来的对象。即对象的浅拷贝会对</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">“</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .7pt">主</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">”</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.7pt">对象进行</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.65pt">拷贝</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .7pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .65pt">但不会复制主对象里面的对</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.45pt">象</span><span style="letter-spacing:.55pt">。</span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">”</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">里面的对象</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">“</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">会在原来的对象和它的副本之间共享</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="text-indent:1.3pt;line-height:94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">简而言</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">之</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">浅拷贝仅仅复制所考虑的对象</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">而不复制它所引用的对象</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:129%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:3.25pt;margin-right:.75pt;margin-bottom: 0cm;margin-left:1.05pt;margin-bottom:.0001pt;line-height:120%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.6pt">深拷贝深拷贝是一个整个独立的</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">对象拷贝</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.6pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">深拷贝会拷贝所有的属性</span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.1pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">并拷贝属性指向的动</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.4pt">态分配的内存。当对象和它所引用</span><span style="letter-spacing:.35pt">的对象一起拷贝时即发生深拷贝</span><span style="letter-spacing: .4pt">。</span><span style="letter-spacing:.35pt">深拷贝相比于浅拷贝速</span> <span style="letter-spacing:.4pt">度较慢并且花销较大</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="text-indent:1.3pt;line-height:94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">简</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.45pt">而言之</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">深拷贝把要复制的对象所引用的对象都复制了一遍</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="line-height:142%"><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top:5.7pt;text-indent:2.0pt;line-height:93%"><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.3pt">17</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">.</span></b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">什么是分布式垃圾回收(</span><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.35pt">DG</span></b><b><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.3pt">C</span></b><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt;mso-style-textoutline-type:solid; mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha:100.0%; mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">)</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">?它是如</span><span style="letter-spacing:.45pt;mso-style-textoutline-type:solid;mso-style-textoutline-fill-color: black;mso-style-textoutline-fill-alpha:100.0%;mso-style-textoutline-outlinestyle-dpiwidth: .515pt;mso-style-textoutline-outlinestyle-linecap:square;mso-style-textoutline-outlinestyle-join: bevel;mso-style-textoutline-outlinestyle-pctmiterlimit:0%;mso-style-textoutline-outlinestyle-dash: solid;mso-style-textoutline-outlinestyle-align:center;mso-style-textoutline-outlinestyle-compound: simple">何工作</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top:10.05pt;text-indent:2.85pt;line-height: 94%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体;letter-spacing:-.85pt;mso-style-textoutline-type: solid;mso-style-textoutline-fill-color:black;mso-style-textoutline-fill-alpha: 100.0%;mso-style-textoutline-outlinestyle-dpiwidth:.515pt;mso-style-textoutline-outlinestyle-linecap: square;mso-style-textoutline-outlinestyle-join:bevel;mso-style-textoutline-outlinestyle-pctmiterlimit: 0%;mso-style-textoutline-outlinestyle-dash:solid;mso-style-textoutline-outlinestyle-align: center;mso-style-textoutline-outlinestyle-compound:simple">的?</span><span lang="EN-US" style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font: minor-fareast;mso-bidi-font-family:宋体"><o:p></o:p></span></p><p class="MsoNormal" style="margin-top:3.95pt;margin-right:.4pt;margin-bottom: 0cm;margin-left:2.3pt;margin-bottom:.0001pt;text-indent:-.75pt;line-height: 120%"><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family: Calibri;letter-spacing:.2pt">R</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.35pt">M</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">I&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">子系统实现基</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">于引用计数的</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">“</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">分布式垃圾回收</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">”</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">(</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">DG</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">)</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.4pt">,</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"> <span style="letter-spacing:.35pt">以便为远程服务器对象提供自动</span> <span style="letter-spacing:.2pt">内存管理</span><span style="letter-spacing:.15pt">设施</span><span style="letter-spacing:.25pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top:0cm;margin-right:.55pt;margin-bottom:0cm; margin-left:1.05pt;margin-bottom:.0001pt;text-indent:.7pt;line-height:120%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.35pt">当客户机创建(序列化</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">)</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">远程引用时</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .45pt">,</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .35pt">会在服务器端</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">DG</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">C</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">上调用</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .25pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">d</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">rt</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">y</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">()</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri"> </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.35pt">当客户机完成远</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">程引用后</span><span style="letter-spacing:.55pt">,</span><span style="letter-spacing:.5pt">它会</span><span style="letter-spacing:.45pt">调用对应的</span><span style="letter-spacing:.35pt"> </span></span><span lang="EN-US" style="font-family: &quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri;letter-spacing:.2pt">c</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">l</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">ean</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">()</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.45pt">方法</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.55pt">。</span><span lang="EN-US" style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体"><o:p></o:p></span></p><p> </p><p class="MsoNormal" style="margin-top:0cm;margin-right:.65pt;margin-bottom:0cm; margin-left:1.05pt;margin-bottom:.0001pt;line-height:121%"><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">针对远程对象的引用由持有该引用的客</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">户机租用一段时间</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">租期从收到</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .3pt"> </span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.25pt">d</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">rt</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.2pt">y</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.15pt">()</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-family:宋体; mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">调用开始</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体;letter-spacing: .55pt">。</span><span style="font-family:宋体;mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.55pt">在此类租约到期之前,客户机必须通过对远</span><span style="letter-spacing: .5pt">程引用额外调用</span><span style="letter-spacing:.3pt"> </span></span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.25pt">d</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.1pt">i</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">rt</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri;letter-spacing:.2pt">y</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif;mso-bidi-font-family:Calibri; letter-spacing:.15pt">()</span><span lang="EN-US" style="font-family:&quot;Calibri&quot;,sans-serif; mso-bidi-font-family:Calibri">&nbsp; </span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.5pt">来更新租约</span><span style="font-family:宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast; mso-bidi-font-family:宋体;letter-spacing:.55pt">。</span><span style="font-family: 宋体;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family: 宋体;letter-spacing:.5pt">如果客户</span><span style="font-family:宋体;mso-fareast-font-family: 宋体;mso-fareast-theme-font:minor-fareast;mso-bidi-font-family:宋体"> <span style="letter-spacing:.5pt">机不在租约到期前进行续签,那么分布式垃</span><span style="letter-spacing: .45pt">圾收集器会假设客户机不再引用远程对象</span><span style="letter-spacing:.5pt">。</span><span lang="EN-US"><o:p></o:p></span></span></p>

上一篇 下一篇

热门资讯