jvm jstat command:
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
Eclipse Memory Analysis Navigate to a code block:
public class MicrosoftConstant {
/**
* TODO TTS 请求头设置
*/
public static final List<Header> TTS_REQUEST_HEADERS = new ArrayList<Header>(){
{
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", "*/*"));
}
};
}
Constants using code blocks:
List<Header> 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);
The interface does not release memory during a large number of accesses。
I have no idea how to solve this problem. Can anyone provide a solution?