关于jvm comand:jstat和jinfo

时间:2017-11-17 10:48:46

标签: java jvm jstat jinfo

jstat得到这个:

S0C    S1C    S0U    S1U      EC       EU        OC         OU       PC     PU    YGC     YGCT    FGC    FGCT     GCT   
64512.0 68096.0 46476.6  0.0   535552.0 125004.4  154624.0   106045.5  29184.0 28595.3     12    0.620   1      0.200    0.820

现在我使用命令./jinfo -flag PermSize 8216获取输出:

-XX:PermSize=21757952

并使用./jinfo -flag MaxPermSize 8216获取:

-XX:MaxPermSize=85983232

关于jstat我在oracle docs找到了消息:

enter image description here

在我看来,PC和PermSize是一样的。显然,那是错的。我怎样才能理解PC和MaxPermSize之间的区别?

在我的服务器上,偶尔会出现永久性的OOM异常现象,我需要做些什么才能扩展PC的容量?

这是一个日志片段:

17-Nov-2017 14:57:24.681 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 53059 ms




start...
17-Nov-2017 14:58:05.202 严重 [pool-20-thread-1] org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler.handleError Unexpected error occurred in scheduled task.
 java.lang.OutOfMemoryError: PermGen space
    at sun.security.ssl.SSLContextImpl.getApplicableCipherSuiteList(SSLContextImpl.java:362)
    at sun.security.ssl.SSLContextImpl.getDefaultCipherSuiteList(SSLContextImpl.java:296)
    at sun.security.ssl.SSLSocketImpl.init(SSLSocketImpl.java:583)
    at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:518)
    at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:73)
    at sun.net.www.protocol.https.HttpsClient.createSocket(HttpsClient.java:409)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:162)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1092)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
    at com.inspur.email.data.netapi.ApiJsonPuller.sendDataToBaiduApi(ApiJsonPuller.java:170)
    at com.inspur.email.data.netapi.ApiJsonPuller.getTrendJson(ApiJsonPuller.java:121)
    at com.inspur.email.data.manager.ProductReport.getReportApiData(ProductReport.java:58)
    at com.inspur.email.producer.ReportEmailProducer.getReportEmail(ReportEmailProducer.java:56)
    at com.inspur.email.manager.MailSendService.createReportEmail(MailSendService.java:82)
    at com.inspur.email.manager.MailSendService.sendReport(MailSendService.java:63)
    at com.inspur.email.controller.MailSendTimeController.startReport(MailSendTimeController.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:64)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53)
    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)

使用jmap获取输出:

Attaching to process ID 8216, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.79-b02

using thread-local object allocation.
Parallel GC with 4 thread(s)

Heap Configuration:
   MinHeapFreeRatio = 0
   MaxHeapFreeRatio = 100
   MaxHeapSize      = 2063597568 (1968.0MB)
   NewSize          = 1310720 (1.25MB)
   MaxNewSize       = 17592186044415 MB
   OldSize          = 5439488 (5.1875MB)
   NewRatio         = 2
   SurvivorRatio    = 8
   PermSize         = 21757952 (20.75MB)
   MaxPermSize      = 85983232 (82.0MB)
   G1HeapRegionSize = 0 (0.0MB)

Heap Usage:
PS Young Generation
Eden Space:
   capacity = 548405248 (523.0MB)
   used     = 548405248 (523.0MB)
   free     = 0 (0.0MB)
   100.0% used
From Space:
   capacity = 66060288 (63.0MB)
   used     = 47592088 (45.387351989746094MB)
   free     = 18468200 (17.612648010253906MB)
   72.04341585673983% used
To Space:
   capacity = 69730304 (66.5MB)
   used     = 0 (0.0MB)
   free     = 69730304 (66.5MB)
   0.0% used
PS Old Generation
   capacity = 158334976 (151.0MB)
   used     = 108590592 (103.56005859375MB)
   free     = 49744384 (47.43994140625MB)
   68.5828202607616% used
PS Perm Generation
   capacity = 29884416 (28.5MB)
   used     = 29322992 (27.964584350585938MB)
   free     = 561424 (0.5354156494140625MB)
   98.12134859854714% used

MaxPermSize为82.0MB,PC为28M,为什么会出现OOM?

0 个答案:

没有答案