当单击TabItems然后切换到列表时,Eclipse挂在Mac OS X上

时间:2012-12-07 04:25:32

标签: eclipse macos jvm swt

我正在Mac OS X 10.7.3上开发一个eclipse插件。 UI由带有4个TabItem的TabFolder和一些其他列表组成。当我在选项卡之间多次切换然后单击另一个列表时,eclipse将挂起。从Activity Monitor我可以看到CPU使用率飙升至100%,Real Mem也在不断增加。 JVM转储如下:

2012-12-07 10:14:14
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.4-b02-402 mixed mode):

"Attach Listener" daemon prio=9 tid=7fa8a4906800 nid=0x116fe7000 waiting on condition [00000000]
   java.lang.Thread.State: RUNNABLE

"[ThreadPool Manager] - Idle Thread" daemon prio=5 tid=7fa8a396a000 nid=0x116ae1000 in Object.wait() [116ae0000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d0133cb8> (a org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor)
    at java.lang.Object.wait(Object.java:485)
    at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:106)
    - locked <7d0133cb8> (a org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor)

"Worker-3" prio=5 tid=7fa89fe4f000 nid=0x114752000 in Object.wait() [114751000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d43e4648> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:188)
    - locked <7d43e4648> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:220)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:50)

"org.eclipse.jface.text.reconciler.MonoReconciler" daemon prio=1 tid=7fa8a3a7c000 nid=0x11730c000 in Object.wait() [11730b000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d5c6c590> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)
    at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:179)
    - locked <7d5c6c590> (a org.eclipse.jface.text.reconciler.DirtyRegionQueue)

"JavaScript indexing" daemon prio=4 tid=7fa8a2aca800 nid=0x11653f000 in Object.wait() [11653e000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d576a0c8> (a org.eclipse.wst.jsdt.internal.core.search.indexing.IndexManager)
    at java.lang.Object.wait(Object.java:485)
    at org.eclipse.wst.jsdt.internal.core.search.processing.JobManager.run(JobManager.java:370)
    - locked <7d576a0c8> (a org.eclipse.wst.jsdt.internal.core.search.indexing.IndexManager)
    at java.lang.Thread.run(Thread.java:680)

"Java indexing" daemon prio=4 tid=7fa8a1c47800 nid=0x1169de000 in Object.wait() [1169dd000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d50c39d8> (a org.eclipse.jdt.internal.core.search.indexing.IndexManager)
    at java.lang.Object.wait(Object.java:485)
    at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:382)
    - locked <7d50c39d8> (a org.eclipse.jdt.internal.core.search.indexing.IndexManager)
    at java.lang.Thread.run(Thread.java:680)

"Worker-2" prio=5 tid=7fa89f49a000 nid=0x11641b000 in Object.wait() [11641a000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d43e4648> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:188)
    - locked <7d43e4648> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:220)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:50)

"Worker-1" prio=5 tid=7fa89f3cc000 nid=0x114dcf000 in Object.wait() [114dce000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d43e4648> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:188)
    - locked <7d43e4648> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:220)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:50)

"Worker-0" prio=5 tid=7fa89d0b0000 nid=0x116169000 in Object.wait() [116168000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d43e4648> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:188)
    - locked <7d43e4648> (a org.eclipse.core.internal.jobs.WorkerPool)
    at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:220)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:50)

"Worker-JM" prio=5 tid=7fa89e886000 nid=0x113f33000 in Object.wait() [113f32000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d4277db8> (a java.util.ArrayList)
    at org.eclipse.core.internal.jobs.InternalWorker.run(InternalWorker.java:58)
    - locked <7d4277db8> (a java.util.ArrayList)

"Bundle File Closer" daemon prio=5 tid=7fa89b33f000 nid=0x114baf000 in Object.wait() [114bae000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d447b468> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at java.lang.Object.wait(Object.java:485)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent(EventManager.java:400)
    - locked <7d447b468> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:336)

"[Timer] - Main Queue Handler" daemon prio=5 tid=7fa89ec29800 nid=0x114ef4000 in Object.wait() [114ef3000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d42e9a50> (a java.lang.Object)
    at org.eclipse.equinox.internal.util.impl.tpt.timer.TimerImpl.run(TimerImpl.java:141)
    - locked <7d42e9a50> (a java.lang.Object)
    at java.lang.Thread.run(Thread.java:680)

"Framework Event Dispatcher" daemon prio=5 tid=7fa89b2f9800 nid=0x1141c6000 in Object.wait() [1141c5000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d43147f0> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at java.lang.Object.wait(Object.java:485)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent(EventManager.java:400)
    - locked <7d43147f0> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:336)

"Start Level Event Dispatcher" daemon prio=5 tid=7fa89e90b800 nid=0x11464f000 in Object.wait() [11464e000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d4314870> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at java.lang.Object.wait(Object.java:485)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent(EventManager.java:400)
    - locked <7d4314870> (a org.eclipse.osgi.framework.eventmgr.EventManager$EventThread)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:336)

"State Data Manager" daemon prio=5 tid=7fa89b15c000 nid=0x113ce4000 waiting on condition [113ce3000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at org.eclipse.osgi.internal.baseadaptor.StateManager.run(StateManager.java:297)
    at java.lang.Thread.run(Thread.java:680)

"Framework Active Thread" prio=5 tid=7fa89b157800 nid=0x113be1000 in Object.wait() [113be0000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d4021de0> (a org.eclipse.osgi.framework.internal.core.Framework)
    at org.eclipse.osgi.framework.internal.core.Framework.run(Framework.java:1862)
    - locked <7d4021de0> (a org.eclipse.osgi.framework.internal.core.Framework)
    at java.lang.Thread.run(Thread.java:680)

"Poller SunPKCS11-Darwin" daemon prio=1 tid=7fa89c10c800 nid=0x112448000 waiting on condition [112447000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at sun.security.pkcs11.SunPKCS11$TokenPoller.run(SunPKCS11.java:692)
    at java.lang.Thread.run(Thread.java:680)

"Thread-1" daemon prio=6 tid=7fa89c002800 nid=0x7fff734ca960 runnable [7fff68d24000]
   java.lang.Thread.State: RUNNABLE
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
    at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221)
    at org.eclipse.swt.widgets.Widget.mouseDownSuper(Widget.java:1093)
    at org.eclipse.swt.widgets.List.mouseDownSuper(List.java:765)
    at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:1085)
    at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2538)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5493)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
    at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221)
    at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2102)
    at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2299)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5557)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
    at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5002)
    at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5151)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
    at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3616)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    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:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    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:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

"Low Memory Detector" daemon prio=5 tid=7fa89e80b000 nid=0x111ed4000 runnable [00000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" daemon prio=9 tid=7fa89e80a800 nid=0x111dd1000 waiting on condition [00000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" daemon prio=9 tid=7fa89e809800 nid=0x111cce000 waiting on condition [00000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Command Reader" daemon prio=5 tid=7fa89b0c9000 nid=0x111bcb000 runnable [00000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Event Helper Thread" daemon prio=5 tid=7fa89b0c7000 nid=0x111ac8000 runnable [00000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Transport Listener: dt_socket" daemon prio=5 tid=7fa89b0c8000 nid=0x1119c5000 runnable [00000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=9 tid=7fa89b0c5800 nid=0x1118bc000 runnable [00000000]
   java.lang.Thread.State: RUNNABLE

"Surrogate Locker Thread (Concurrent GC)" daemon prio=5 tid=7fa89b0c4800 nid=0x1117b9000 waiting on condition [00000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=8 tid=7fa89d041800 nid=0x1114f5000 in Object.wait() [1114f4000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d4024710> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
    - locked <7d4024710> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=7fa89d041000 nid=0x1113f2000 in Object.wait() [1113f1000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7d4020878> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:485)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
    - locked <7d4020878> (a java.lang.ref.Reference$Lock)

"main" prio=5 tid=7fa89b001000 nid=0x1099f9000 runnable [00000000]
   java.lang.Thread.State: RUNNABLE

"VM Thread" prio=9 tid=7fa89d03c000 nid=0x1112ef000 runnable 

"Gang worker#0 (Parallel GC Threads)" prio=9 tid=7fa89b002800 nid=0x10cd72000 runnable 

"Gang worker#1 (Parallel GC Threads)" prio=9 tid=7fa89b003000 nid=0x10ce75000 runnable 

"Gang worker#2 (Parallel GC Threads)" prio=9 tid=7fa89b003800 nid=0x10cf78000 runnable 

"Gang worker#3 (Parallel GC Threads)" prio=9 tid=7fa89b004000 nid=0x10d07b000 runnable 

"Concurrent Mark-Sweep GC Thread" prio=9 tid=7fa89b07f800 nid=0x110f90000 runnable 
"VM Periodic Task Thread" prio=10 tid=7fa89e81d000 nid=0x111fd7000 waiting on condition 

"Exception Catcher Thread" prio=10 tid=7fa89b001800 nid=0x109b99000 runnable 
JNI global references: 11239

有没有人知道发生了什么?

1 个答案:

答案 0 :(得分:1)

经过调查,我终于找到了根本原因。它不是由Tab引起的,而是由List引起的。单击列表上的空白区域(列表中的行数多于条目数)时,list.getSelection()仍将是Windows上当前选定的项目,但在Mac上将为空。当通过list.getSelection()[0]检索值时,eclipse将挂起而不是抛出ArrayIndexOutOfBoundsException()。我通过使用局部变量记住当前选择并在用户点击空白区域时设置选择来解决这个问题。