Eclipse崩溃,“无法创建新的本机线程” - 有任何想法吗? (我的设置和信息里面) [英] Eclipse crashes with "Unable to create new native thread" - any ideas? (my settings and info inside)

查看:240
本文介绍了Eclipse崩溃,“无法创建新的本机线程” - 有任何想法吗? (我的设置和信息里面)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse中遇到麻烦,常常对我大吃一惊(而且一般情绪低落),我想知道有没有人可以给我任何见解。引发的消息是无法创建新的本机线程。此时,系统会提示您重新启动Eclipse。我每天都会发生5次左右的时间。



我正在使用Ecliipse Helios Service Release 2(使用Flash Builder插件):

  Windows Vista Business 
处理器:Intel Core 2 Duo T7500 @ 2.20 GHz
内存(RAM):4.00 GB
系统类型: 32位操作系统

我的eclipse.ini设置被从这个线程:eclipse的最佳jvm设置是什么

  -startup 
plugins / org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins / org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
-vm
C:/jdk1.6.0_25/jre/bin/client/jvm.dll
-vmargs
-Dosgi.requiredJavaVersion = 1.6
-Dec lipse.p2.unsignedPolicy = allow
-Xmn256m
-Xms1024m
-Xmx1024m
-Xss4m
-XX:PermSize = 256m
-XX:MaxPermSize = 256m
-XX:CompileThreshold = 5
-XX:MaxGCPauseMillis = 10
-XX:MaxHeapFreeRatio = 70
-XX:+ CMSIncrementalPacing
-XX:+ UnlockExperimentalVMOptions
-XX:+ UseG1GC
-XX:+ UseFastAccessorMethods
-Dcom.sun.management.jmxremote

感谢任何帮助!



编辑:



@normalocity - 错误字面上刚刚发生(未处理的事件循环异常),这是调整我的eclipse.ini(我将Xss更改为1m,MaxPermSize为384m,Xms为512)。以下是您要求的附加信息,异常堆栈跟踪:

  java.lang.OutOfMemoryError:无法创建新的本机线程
在java.lang.Thread.start0(本机方法)
在java.lang.Thread.start(Thread.java:640)
在org.eclipse.jface.text.contentassist.ContentAssistant $ AutoAssistListener.start(ContentAssistant.java:263)
在org.eclipse.jface.text.contentassist.ContentAssistant $ AutoAssistListener.keyPressed(ContentAssistant.java:345)
在com.adobe.flexide.editorcore .contentassist.FlexContentAssistant $ FlexAutoAssistListener.keyPressed(FlexContentAssistant.java:47)
在org.eclipse.jface.text.contentassist.ContentAssistant $ InternalListener.verifyKey(ContentAssistant.java:811)
在org.eclipse .jface.text.TextViewer $ VerifyKeyListenersManager.verifyKey(TextViewer.java:489)
在org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:65)
在org.eclipse.swt .widgets.EventTable.sendEvent(EventTable.java:84)
在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
在org .eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
在org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
在org.eclipse.swt .custom.StyledText.handleKeyDown(StyledText.java:5957)
在org.eclipse.swt.custom.StyledText $ 7.handleEvent(StyledText.java:5656)
在org.eclipse.swt.widgets。 EventTable.sendEvent(EventTable.java:84)
在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
在org.eclipse.swt.widgets.Widget.sendEvent( Widget.java:1077)
在org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
在org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java: 1103)
在org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
在org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508)
在org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4270)
在org.eclipse.swt.widg ets.Canvas.WM_CHAR(Canvas.java:345)
在org.eclipse.swt.widgets.Control.windowProc(Control.java:4162)
在org.eclipse.swt.widgets.Canvas。 windowProc(Canvas.java:341)
在org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
在org.eclipse.swt.internal.win32.OS.DispatchMessageW( Native方法)
在org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
在org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655 )
在org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
在org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
在org.eclipse.ui.internal.Workbench.access $ 4(Workbench.java:2438)
在org.eclipse.ui.internal.Workbench $ 7.run(Workbench.java:671)
在org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
在org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
在org。 eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
在org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
在org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java: 79)
在org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
在org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java: 179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodMethodAccessorImpl.java:25)
在java.lang.reflect.Method.invoke(Method.java:597)
在org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
在org.eclipse.equinox.launcher.Main.basicRun(Main.ja va:575)
在org.eclipse.equinox.launcher.Main.run(Main.java:1408)


解决方案

似乎没有足够的内存用于新的线程堆栈。在Windows上,进程空间是 2GB 。对于堆,您最初分配1Gb(-Xms选项),因此从一开始就锁定。 Minus 256Mb类(PermSize),减去可能高达0.5Gb的JVM开销。因此,您的线程对于堆栈只有大约256Mb,这是最多64个线程(256 / 4m)。



解决方案:尝试降低堆栈大小到-Xss1024k或减少初始堆大小(-Xms)



相关阅读关于 OutOfMemory:无法创建线程



作为附注,-XX:MaxPermSize = 256m看起来太小Eclipse for EE。更好地设置为384。



干杯,
最大


I'm having trouble with Eclipse routinely crapping out on me (and being generally sluggish) and I was wondering if anyone could give me any insight. The message that gets thrown is "Unable to create new native thread." at which point I'm prompted to restart Eclipse. This happens 5 or so times a day.

I'm using Ecliipse Helios Service Release 2 (with Flash Builder plugin) on:

Windows Vista Business
Processor: Intel Core 2 Duo T7500 @ 2.20 GHz
Memory (RAM): 4.00 GB
System Type: 32-bit Operating System

My eclipse.ini settings which were stolen from this thread: What are the best jvm settings for eclipse:

-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
-vm
C:/jdk1.6.0_25/jre/bin/client/jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Declipse.p2.unsignedPolicy=allow
-Xmn256m
-Xms1024m
-Xmx1024m
-Xss4m
-XX:PermSize=256m
-XX:MaxPermSize=256m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+CMSIncrementalPacing
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+UseFastAccessorMethods
-Dcom.sun.management.jmxremote

Thanks for any help!

edit:

@normalocity - the error literally just happened (Unhandled event loop exception), this is after adjusting my eclipse.ini (I changed Xss to 1m, MaxPermSize to 384m, Xms to 512). Here is the additional info you asked for, exception stack trace:

java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:640)
at org.eclipse.jface.text.contentassist.ContentAssistant$AutoAssistListener.start(ContentAssistant.java:263)
at org.eclipse.jface.text.contentassist.ContentAssistant$AutoAssistListener.keyPressed(ContentAssistant.java:345)
at com.adobe.flexide.editorcore.contentassist.FlexContentAssistant$FlexAutoAssistListener.keyPressed(FlexContentAssistant.java:47)
at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:811)
at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:489)
at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:65)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)
at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5957)
at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5656)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4270)
at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4162)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)

解决方案

It appears that there is not enough memory for new thread stack. On Windows, process space is 2GB. For heap you initially allocate 1Gb (-Xms option), so it's locked from the beginning. Minus 256Mb for classes (PermSize), minus JVM overhead which could be as much as 0.5Gb. So as a result, your threads have only about 256Mb for stacks, which is maximum 64 threads (256/4m).

Solution: Try to lower stack size to -Xss1024k or reduce initial heap size (-Xms).

Related reading about OutOfMemory: unable to create thread

As a side note, -XX:MaxPermSize=256m looks too small for Eclipse for EE. Better to set to 384.

Cheers, Max

这篇关于Eclipse崩溃,“无法创建新的本机线程” - 有任何想法吗? (我的设置和信息里面)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆