jetty java.lang.OutOfMemoryError: PermGen space

來源:互聯網
上載者:User

PermGen space全稱是permanent generation space,是JVM中用來儲存Class(屬性,方法,靜態成員)資訊的那一部分記憶體,GC不會主動回收這一部分記憶體,可稱之為JVM中記憶體的永久儲存地區

這2天測試程式的時候,隔段時間就會碰到這個錯,記錄一下尋找問題的方法和修改JVM參數的方法

可用jstat命令查看記憶體狀況   jstat -gcpermcapacity pid

官方命令使用說明

http://download.oracle.com/javase/1.5.0/docs/tooldocs/share/jstat.html 

修改JVM參數

JAVA_OPTS='-Xms1024m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=256m '  


  • -XX:+CMSPermGenSweepingEnabled :
    this setting enables garbage collection in the permgenspace
  • -XX:+CMSClassUnloadingEnabled :
    allows the garbage collector to remove even classes from the memory
  • -XX:PermSize=64M
    -XX:MaxPermSize=128M
     : raises the amount of memory allocated to the permgenspace

這個問題好像是因為jetty的熱部署導致的,應該是jetty的熱部署有BUG,我用的jetty版本(jetty-hightide-7.6.0.RC0)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.