MyEclipse/Eclipse的記憶體最佳化與記憶體不足的解決辦法

來源:互聯網
上載者:User

做項目的時候,MyEclipse提示記憶體不足,我本本記憶體1G的呀。
錯誤提示大概如下:
MyEclipse has detected that less than 5% of the 64MB of Perm
Gen (Non-heap memory) space remains. It is strongly recommended
that you exit and restart MyEclipse with new virtual machine memory
paramters to increase this memory.   Failure to do so can result in
data loss. The recommended Eclipse memory parameters are:
eclipse.exe -vmargs -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M

以下是我的MyEclipse捷徑的參數:
"D:/Eclipse 3.2.2/eclipse.exe" -product com.genuitec.myeclipse.product.ide -vmargs -Duser.language=en -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M   -Dosgi.splashLocation="d:////MyEclipse 5.0GA////eclipse////MyEclipseSplash.bmp"

對於MyEclipse的話,直接修改MyEclipse在案頭的捷徑的參數就可以啦。現在解釋這些參數的意思。

-vmargs:說明後面是VM的參數
-Xms40m:虛擬機器佔用系統的最小記憶體
-Xmx256m:虛擬機器佔用系統的最大記憶體
-XX:PermSize:最小堆大小。一般報記憶體不足時,都是說這個太小,
                      堆空間剩餘小於5%就會警告,建議把這個稍微設
                           大一點,不過要視自己機器記憶體大小來設定
-XX:MaxPermSize:最大堆大小。這個也適當大些
-Xmx512M的5%為25.6M,理論上要求-Xmx的數值與-XX:MaxPermSize必須大於25.6M

把裡面的參數改為
-vmargs  
-Xms128M  
-Xmx512M  
-XX:PermSize=128M  
-XX:MaxPermSize=256M

所以對於我而言,我只要把我的MyEclipse5.0改-XX:PermSize=128M-XX:MaxPermSize=256M,問題解決!
(個人補充一點:參數在你安裝的exlipse目錄下的eclipse.ini檔案中)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.