在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
但是问题就这样解决了,再也不会闪退啦。