在Ubuntu(或者其他平台)開發JSP網站的時候,大都選擇使用MyEclipse來開發。
這裡分享一下MyEclipse使用時閃退的情況處理。
閃退原因:使用代碼提示快捷鍵
閃退樣式:直接退出,並生成一個錯誤日志文件
錯誤日志文件:
#
# An unexpected error has been detected by Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f423ca0c2a1, pid=3294, tid=139925162981120
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.3-b02 mixed mode linux-amd64)
# Problematic frame:
# C [libsoup-2.4.so.1+0x6c2a1] soup_session_feature_detach+0x11
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x00007f42d8007c00): JavaThread "main" [_thread_in_native, id=3295, stack(0x00007f42dd927000,0x00007f42dda28000)]
siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x0000000000000000
Registers:
#####中間的部分省略了,太多了
Environment Variables:
JAVA_HOME=/usr/local/jdk1.7.0
JRE_HOME=.:/usr/local/jdk1.7.0/jre
CLASSPATH=.:/usr/local/jdk1.7.0/lib:.:/usr/local/jdk1.7.0/jre/lib
PATH=/usr/local/jdk1.7.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
LD_LIBRARY_PATH=/home/gopain/MyEclipse/Common/binary/com.sun.java.jdk.linux.x86_64_1.6.0.013/jre/lib/amd64/server:/home/gopain/MyEclipse/Common/binary/com.sun.java.jdk.linux.x86_64_1.6.0.013/jre/lib/amd64:/home/gopain/MyEclipse/Common/binary/com.sun.java.jdk.linux.x86_64_1.6.0.013/jre/../lib/amd64
SHELL=/bin/bash
DISPLAY=:0.0
Signal Handlers:
SIGSEGV: [libjvm.so+0x5fcd20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGBUS: [libjvm.so+0x5fcd20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGFPE: [libjvm.so+0x4e0eb0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGPIPE: SIG_IGN, sa_mask[0]=0x00001000, sa_flags=0x10000000
SIGXFSZ: [libjvm.so+0x4e0eb0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGILL: [libjvm.so+0x4e0eb0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: [libjvm.so+0x4e35d0], sa_mask[0]=0x00000000, sa_flags=0x10000004
SIGHUP: [libjvm.so+0x4e3320], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGINT: [libjvm.so+0x4e3320], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGTERM: [libjvm.so+0x4e3320], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGQUIT: [libjvm.so+0x4e3320], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
--------------- S Y S T E M ---------------
OS:jessie/sid
uname:Linux 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64
libc:glibc 2.19 NPTL 2.19
rlimit: STACK 8192k, CORE 0k, NPROC 30376, NOFILE 4096, AS infinity
load average:0.99 1.06 0.81
CPU:total 2 (8 cores per cpu, 2 threads per core) family 6 model 5 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, ht
Memory: 4k page, physical 3909676k(1213728k free), swap 4051964k(4051964k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (11.3-b02) for linux-amd64 JRE (1.6.0_13-b03), built on Mar 9 2009 11:08:22 by "java_re" with gcc 3.2.2 (SUSE Linux)
time: Wed May 14 12:58:44 2014
elapsed time: 109 seconds
我原本以為只是使用代碼提示快捷鍵的時候會閃退[代碼提示時耗內存],只要不使用代碼提示仍然可以正常開發。但明顯略顯天真,使用一會兒也會自動退出且沒有任何提示。
網上查了很多資料,未果[百度]。
後來還是查到了。
解決方案:
修改myeclipse.ini文件,
-Xmx512m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=256m
-Dosgi.nls.warnings=ignore
把內存分配調大一些,不要擔心myeclipse真的會使用過多內存,這個軟件是十分負責的,不是給多少內存就用多少。這個沒有完全解決問題。
然後在此文件中追加:
-Dorg.eclipse.swt.browser.DefaultType=mozilla
-Dorg.eclipse.swt.browser.UseWebKitGTK=true
-Dorg.eclipse.swt.browser.XULRunnerPath==/usr/lib/xulrunner-2
第一條是打開jsp文件閃退,第二、三條是打開class文件閃退,完全不是使用代碼提示的原因。
但是問題就這樣解決了,再也不會閃退啦。
MyEclipse啟動Tomcat緩慢的原因及解決辦法 http://www.linuxidc.com/Linux/2014-04/100030.htm
Ubuntu 12.10中MyEclipse 10.6+下載+安裝+破解 http://www.linuxidc.com/Linux/2013-06/86102.htm
安裝MyEclipse10.0 Linux+破解 http://www.linuxidc.com/Linux/2013-04/82212.htm
MyEclipse中配置JDK環境變量 http://www.linuxidc.com/Linux/2013-02/80017.htm
Ubuntu下安裝MyEclipse10和MySQL全程圖解 http://www.linuxidc.com/Linux/2013-01/77869.htm
MyEclipse10 開發 SSH2(Struts2.1+Spring+Hibernate) http://www.linuxidc.com/Linux/2012-07/64859.htm
Ubuntu 13.04 配置MyEclipes 10.7環境 http://www.linuxidc.com/Linux/2014-05/101751.htm
更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2