title: Java constant reference causes memory leak？
body: <p>jvm jstat command：</p>
  
  <pre><code>  jstat -gcutil 14378 2000 20
    S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT     GCT   
    8.04   0.00  87.61   9.06  96.45  94.34    702   13.804     8    2.521   16.325
  </code></pre>
  
  <p>Eclipse Memory Analysis Navigate to a code block：</p>
  
  <pre><code>public class MicrosoftConstant {
  
  /**
   * TODO TTS 请求头设置
   */
  public static final List&lt;Header&gt; TTS_REQUEST_HEADERS = new ArrayList&lt;Header&gt;(){
      {
          add(new BasicHeader("Content-Type", "application/ssml+xml"));
          add(new BasicHeader("X-Microsoft-OutputFormat", "xxx"));
          add(new BasicHeader("X-Search-AppId", "xxx"));
          add(new BasicHeader("X-Search-ClientID", "xxx"));
          add(new BasicHeader("User-Agent", "xxx"));
          add(new BasicHeader("Accept", "*/*"));
      }
  };
  </code></pre>
  
  <p>}</p>
  
  <p>Constants using code blocks：</p>
  
  <pre><code>List&lt;Header&gt; headers = MicrosoftConstant.TTS_REQUEST_HEADERS;
      headers.add(new BasicHeader("Ocp-Apim-Subscription-Key", microsoftConfig.getAppKey()));
      headers.add(new BasicHeader("Authorization", "Bearer " + authToken));
      InputStream audioStream = null;
  
          HttpEntity httpEntity = httpApiService.doPost(microsoftConfig.getTtsUrl(), body.getBytes(), headers);
  </code></pre>
  
  <p>The interface does not release memory during a large number of accesses。</p>
  
  <p>I have no idea how to solve this problem. Can anyone provide a solution?</p>