2017-08-23 117 views
0

當我使用jstack檢查過程中,冰絲的等待,我有這個日誌:如何檢查對象

"poolTaskThread-4" prio=10 tid=0x00007f09300ff800 nid=0x69ce in Object.wait() [0x00007f0aa5271000] 
java.lang.Thread.State: WAITING (on object monitor) 
at java.lang.Object.wait(Native Method) 
at java.lang.Object.wait(Object.java:503) 
at IceInternal.Outgoing.invoke(Outgoing.java:147) 
- locked <0x0000000711754358> (a IceInternal.Outgoing) 
at com.example.srv.slice._ContentSearchServiceDelM.searchContentsFields(_ContentSearchServiceDelM.java:188) 
at com.example.srv.slice.ContentSearchServicePrxHelper.searchContentsFields(ContentSearchServicePrxHelper.java:665) 
at com.example.srv.slice.ContentSearchServicePrxHelper.searchContentsFields(ContentSearchServicePrxHelper.java:629) 
at com.example.srv.api.ContentSearchServiceAPI.searchContentsFields(ContentSearchServiceAPI.java:61) 
at com.bbs.dao.ContentDao.getSortedContentsByNode(ContentDao.java:921) 
at com.bbs.dao.ContentDao.getPublishContentListPage(ContentDao.java:613) 
at com.bbs.service.ContentService.getPublishContentListPage(ContentService.java:60) 
at com.example.service.impl.FindSummImpl.getArtificialContentList(FindSummImpl.java:227) 
at com.example.service.impl.FindSummImpl.sortList(FindSummImpl.java:316) 
at com.example.service.impl.MatcherImpl$PluginTask.dosortlist(MatcherImpl.java:654) 
at com.example.service.impl.MatcherImpl$PluginTask.getPluginContentByQuery(MatcherImpl.java:720) 
at com.example.service.impl.MatcherImpl$PluginTask.call(MatcherImpl.java:589) 
at com.example.service.impl.MatcherImpl$PluginTask.call(MatcherImpl.java:472) 
at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
at java.lang.Thread.run(Thread.java:745) 

,並有許多其他類似this.First我想這是因爲冰的連接超時設置問題,因爲我在管線147找到Outgoing.java是這樣的:

 int timeout = connection.timeout(); 
       while(_state == StateInProgress && !timedOut) 
       { 
        try 
        { 
         if(timeout >= 0) 
         { 
          wait(timeout); 

          if(_state == StateInProgress) 
          { 
           timedOut = true; 
          } 
         } 
         else 
         { 
          wait(); 
         } 
        } 
        catch(InterruptedException ex) 
        { 
        } 
       } 
      } 

      if(timedOut) 
      { 
       // 
       // Must be called outside the synchronization of 
       // this object 
       // 
       connection.exception(new Ice.TimeoutException()); 

       // 
       // We must wait until the exception set above has 
       // propagated to this Outgoing object. 
       // 
       synchronized(this) 
       { 
        while(_state == StateInProgress) 
        { 
         try 
         { 
          wait(); //147 line 
         } 
         catch(InterruptedException ex) 
         { 
         } 
        } 
       } 
      } 

所以我必須添加的第Ice.Override.Connection = 200000,但問題出現得越早,我應該怎麼辦關於冰線~~

回答

1

冰有一個paramters被稱爲Ice.CacheMessageBuffer,你可以設置這個

Ice.CacheMessageBuffers=0 

這會不會致電directbuffer,你可以嘗試它,它會提高JVM GC。