"Cluster-MembershipReceiver" java.lang.OutOfMemoryError
本來找了臺linux伺服器,打算用tomcat5.5.30和apache2.2.6搭建個叢集測試環境,一切按原來的方式安裝配置完畢,啟動一個tomcat,居然報如下錯誤,雖然不影響應用正常啟動,但還是沒達到效果:
警告: Error receiving mcast package (errorCounter=0). Sleeping 500 ms
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at org.apache.catalina.cluster.mcast.McastMember.getMember(McastMember.java:175)
at org.apache.catalina.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.java:265)
at org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:355)
Exception in thread "Cluster-MembershipReceiver" java.lang.OutOfMemoryError: Java heap space
at org.apache.catalina.cluster.mcast.McastMember.getMember(McastMember.java:174)
at org.apache.catalina.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.java:265)
at org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:355)
2012-9-24 16:07:25 org.apache.catalina.cluster.mcast.McastService registerMBean
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at org.apache.catalina.cluster.mcast.McastMember.getMember(McastMember.java:175)
at org.apache.catalina.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.java:265)
at org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:355)
Exception in thread "Cluster-MembershipReceiver" java.lang.OutOfMemoryError: Java heap space
at org.apache.catalina.cluster.mcast.McastMember.getMember(McastMember.java:174)
at org.apache.catalina.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.java:265)
at org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:355)
2012-9-24 16:07:25 org.apache.catalina.cluster.mcast.McastService registerMBean
奇怪了,我明明設定了JAVA_OPTS引數,怎麼會報記憶體溢位,去掉應用再啟動tomcat,報錯依舊。是不是JAVA_OPTS配置沒起作用,如是把JAVA_OPTS的配置移到/etc/profile裡面,再次啟動tomcat,記憶體溢位的錯誤不報了,但不停的報下面的錯誤:
警告: Error receiving mcast package (errorCounter=0). Sleeping 500 ms
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at org.apache.catalina.cluster.mcast.McastMember.getMember(McastMember.java:175)
at org.apache.catalina.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.java:265)
at org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:355)
2012-9-24 17:10:40 org.apache.catalina.cluster.mcast.McastService registerMBean
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at org.apache.catalina.cluster.mcast.McastMember.getMember(McastMember.java:175)
at org.apache.catalina.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.java:265)
at org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.run(McastServiceImpl.java:355)
2012-9-24 17:10:40 org.apache.catalina.cluster.mcast.McastService registerMBean
找到tomcat5.5的原始碼,找到問題程式碼,問題出在這個計算
byte[] nlend = new byte[4];
System.arraycopy(data, 16, nlend, 0, 4);
int nlen = XByteBuffer.toInt(nlend, 0);
System.arraycopy(data, 16, nlend, 0, 4);
int nlen = XByteBuffer.toInt(nlend, 0);
發現這段程式碼重複執行了N次,第一次正常,第二次就開始報錯,這裡返回的 nlen 引數很大。
暫時也找不到解決辦法了,沒時間深入研究。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9399028/viewspace-744947/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- java.lang.OutOfMemoryErrorJavaError
- java.lang.OutOfMemoryError: PermGen spaceJavaError
- java.lang.OutOfMemoryError: Java heap spaceJavaError
- java.lang.OutOfMemoryError及解決方案JavaError
- 已經解決java.lang.OutOfMemoryErrorJavaError
- kettle java.lang.OutOfMemoryError: Java heap spaceJavaError
- java.lang.OutOfMemoryError:unabletocreatenewnativethread(轉)JavaErrorthread
- Tomcat:Caused by: java.lang.OutOfMemoryError: PermGen space .TomcatJavaError
- java.lang.OutOfMemoryError: Java heap space的解決JavaError
- mysql 報錯:java.lang.OutOfMemoryError: Java heap spaceMySqlJavaError
- java.lang.OutOfMemoryError: PermGen space及其解決方法JavaError
- 轉享: java.lang.OutOfMemoryError: PermGen space 問題JavaError
- Error creating bean with name 'memcachedClient'...java.lang.OutOfMemoryErrorErrorBeanclientJava
- 一個看法 關於java.lang.OutOfMemoryError: PermGen spaceJavaError
- eclipse java.lang.OutOfMemoryError: Java heap space 解決方案EclipseJavaError
- idea專案啟動報錯:java.lang.OutOfMemoryErrorIdeaJavaError
- opatch java.lang.OutOfMemoryError:Java heap space錯誤一例JavaError
- 救命啊java.lang.OutOfMemoryError: unable to create new native threadJavaErrorthread
- java.lang.OutOfMemoryError: unable to create new native thread如何解決JavaErrorthread
- Tomcat發生java.lang.OutOfMemoryError: PermGen space的解決方案TomcatJavaError
- Weblogic開啟managed server報錯java.lang.OutOfMemoryError: PermGen spaceWebServerJavaError
- 測試 web程式,tomcat出現java.lang.OutOfMemoryError異常。WebTomcatJavaError
- 手動寫java記憶體溢位 java.lang.OutOfMemoryError: PermGen spaceJava記憶體溢位Error
- Jmeter記憶體溢位:java.lang.OutOfMemoryError: Java heap space解決思路JMeter記憶體溢位JavaError
- Idea執行遇到:maven-resources-production....:java.lang.OutOfMemoryError: Java heap spaceIdeaMavenJavaError
- 手動寫java OOM記憶體溢位 java.lang.OutOfMemoryError: Java heap spaceJavaOOM記憶體溢位Error
- 手動寫java OOM記憶體溢位 java.lang.OutOfMemoryError: GC overhead limit exceededJavaOOM記憶體溢位ErrorGCMIT
- myeclipse執行tomcat報錯Exception in thread "main" java.lang.OutOfMemoryError: PermGen space...EclipseTomcatExceptionthreadAIJavaError
- Maven編譯出現“java.lang.OutOfMemoryError: Java heap space”問題及解決辦法Maven編譯JavaError
- 【idea】編譯java專案時出現java.lang.OutOfMemoryError: GC overhead limit exceededIdea編譯JavaErrorGCMIT
- 模擬實戰排查堆記憶體溢位(java.lang.OutOfMemoryError: Java heap space)問題記憶體溢位JavaError
- myeclipse中tomcat部署程式出現:java.lang.OutOfMemoryError:PermGen space 異常解決方法EclipseTomcatJavaError
- spark大批量讀取Hbase時出現java.lang.OutOfMemoryError: unable to create new native threadSparkJavaErrorthread
- java.lang.OutOfMemoryError: unable to create new native thread問題排查以及當前系統最大程式數量JavaErrorthread