This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 166843

Summary: j2me preprocessor freeze
Product: javame Reporter: vallej <vallej>
Component: FragmentationAssignee: Petr Suchomel <psuchomel>
Status: VERIFIED FIXED    
Severity: blocker CC: aste, ca-nb, estevan.diedrich, rbalada, vnhjdh, vstejskal
Priority: P1    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Sample app to reproduce the issue
editing in huge preprocessor block
editor freeze - a profile snapshot
Snapshot of new nightly develop version
org-netbeans-modules-mobility-editor.jar
Snapshot of new module
Log messages file from use of new module
with replaced org-netbeans-modules-mobility-editor.jar
New profiler snapshot with latest updates
Another example to reproduce the issue
Slow editor with lastest build
snapshots (thread dumps)
org-netbeans-modules-mobility-editor.jar
Build 201003220200. Snapshot is taken while typing //#if ABC
Build 201003220200. Snapshot is taken while typing within //#if - //#endif block
Even without preprocessor is impossible use VMD.
fixed org-netbeans-modules-mobility-editor.jar
archived snapshots with freezed editor
Patched jar file (made from trunk sources)

Description vallej 2009-06-10 11:16:42 UTC
Every time when I try to enter something like
//#if SOME_COND
...
//#endif
in my J2ME project, netbeans freezes. Netbeans 6.5 unfreezes in 5-200 sec., Netbeans 6.7 RC2 freezes forever.

The only solution is to type //#endif first. Freeze time depends of the file size - ~50kb file gives approx. 1 minute of
delay, 1kb - several seconds.
Comment 1 Jiri Prox 2009-06-10 11:26:33 UTC
Can you please capture thread dump, when IDE is frozen?
http://wiki.netbeans.org/GenerateThreadDump
Comment 2 vallej 2009-06-10 12:13:51 UTC
Netbeans 6.7 RC2 while freezing:
Microsoft Windows XP [Версия 5.1.2600]
(С) Корпорация Майкрософт, 1985-2001.

C:\java\NetBeans_6_7rc2\bin>netbeans

C:\java\NetBeans_6_7rc2\bin>

The launcher has determined that the parent process has a console and will reuse
 it for its own console output. Closing the console will result in termination o
f the running program.
Use '--console suppress' to suppress console output.
Use '--console new' to create a separate console window.


C:\java\NetBeans_6_7rc2\bin>2009-06-10 15:08:38
Full thread dump Java HotSpot(TM) Client VM (11.0-b16 mixed mode):

"Parsing & Indexing Loop (200906042131)" daemon prio=2 tid=0x02eb3800 nid=0x123c
 in Object.wait() [0x0becf000..0x0becfc94]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x136ed470> (a org.netbeans.modules.parsing.impl.TaskProce
ssor$CurrentRequestReference$CRRLock)
        at java.lang.Object.wait(Object.java:485)
        at org.netbeans.modules.parsing.impl.TaskProcessor$CurrentRequestReferen
ce.setCurrentTask(TaskProcessor.java:896)
        - locked <0x136ed470> (a org.netbeans.modules.parsing.impl.TaskProcessor
$CurrentRequestReference$CRRLock)
        at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(Ta
skProcessor.java:706)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44
1)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
        at java.lang.Thread.run(Thread.java:619)

"TimerQueue" daemon prio=6 tid=0x07d46000 nid=0x1fc0 in Object.wait() [0x0b49f00
0..0x0b49fd94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x12b07238> (a javax.swing.TimerQueue)
        at javax.swing.TimerQueue.run(TimerQueue.java:236)
        - locked <0x12b07238> (a javax.swing.TimerQueue)
        at java.lang.Thread.run(Thread.java:619)

"AWT-EventQueue-1" prio=6 tid=0x070e1000 nid=0x1fb8 runnable [0x076bf000..0x076b
fa14]
   java.lang.Thread.State: RUNNABLE
        at java.lang.Object.clone(Native Method)
        at java.util.Arrays$ArrayList.toArray(Arrays.java:3366)
        at java.util.ArrayList.addAll(ArrayList.java:472)
        at org.netbeans.api.editor.settings.AttributesUtilities.createComposite(
AttributesUtilities.java:143)
        at org.netbeans.spi.editor.highlighting.support.OffsetsBag.merge(Offsets
Bag.java:656)
        at org.netbeans.spi.editor.highlighting.support.OffsetsBag.addHighlightI
mpl(OffsetsBag.java:496)
        at org.netbeans.spi.editor.highlighting.support.OffsetsBag.addHighlight(
OffsetsBag.java:161)
        - locked <0x1532e370> (a org.netbeans.modules.editor.lib2.highlighting.O
ffsetGapList)
        at org.netbeans.modules.mobility.editor.ConfigurationHighlightsLayerFact
ory$BlocksHighlighting$2.run(ConfigurationHighlightsLayerFactory.java:156)
        at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1371)
        at org.netbeans.modules.mobility.editor.ConfigurationHighlightsLayerFact
ory$BlocksHighlighting.updateBags(ConfigurationHighlightsLayerFactory.java:147)
        at org.netbeans.modules.mobility.editor.DocumentPreprocessor.setLineList
(DocumentPreprocessor.java:162)
        at org.netbeans.modules.mobility.editor.DocumentPreprocessor.updateBlock
Chain(DocumentPreprocessor.java:203)
        at org.netbeans.modules.mobility.editor.DocumentPreprocessor$3.actionPer
formed(DocumentPreprocessor.java:176)
        at javax.swing.Timer.fireActionPerformed(Timer.java:271)
        at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.j
ava:104)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

"pool-1-thread-1" prio=6 tid=0x07b09400 nid=0x1ef0 waiting on condition [0x0b29f
000..0x0b29fa94]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x129ae340> (a java.util.concurrent.locks.Abstra
ctQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
.await(AbstractQueuedSynchronizer.java:1925)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.jav
a:358)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.ja
va:947)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:907)
        at java.lang.Thread.run(Thread.java:619)

"Inactive RequestProcessor thread [Was:Default RequestProcessor/null]" daemon pr
io=2 tid=0x07aef400 nid=0x1e9c in Object.wait() [0x0b09f000..0x0b09fb14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x129abca0> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x129abca0> (a java.lang.Object)

"*** JFluid Separate Command Execution Thread" daemon prio=6 tid=0x07b07c00 nid=
0x1e8c in Object.wait() [0x0ac9f000..0x0ac9fb94]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x1299e278> (a java.lang.Object)
        at java.lang.Object.wait(Object.java:485)
        at org.netbeans.lib.profiler.ProfilerClient$SeparateCmdExecutionThread.r
un(ProfilerClient.java:102)
        - locked <0x1299e278> (a java.lang.Object)

"Thread-4" daemon prio=2 tid=0x07ae0000 nid=0x1edc in Object.wait() [0x0aa9f000.
.0x0aa9fc14]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x1267b6b0> (a java.util.LinkedList)
        at java.lang.Object.wait(Object.java:485)
        at java.util.prefs.AbstractPreferences$EventDispatchThread.run(AbstractP
references.java:1461)
        - locked <0x1267b6b0> (a java.util.LinkedList)

"Inactive RequestProcessor thread [Was:AntProjectHelper.RP/org.netbeans.spi.proj
ect.support.ant.AntProjectHelper$RunnableImpl]" daemon prio=2 tid=0x07ae0400 nid
=0x1ebc in Object.wait() [0x0a89f000..0x0a89fc94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x12985de0> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x12985de0> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:Default RequestProcessor/null]" daemon pr
io=2 tid=0x07ab7000 nid=0x1e68 in Object.wait() [0x0a69f000..0x0a69fd14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x12966b90> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x12966b90> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:Default RequestProcessor/org.netbeans.mod
ules.project.ui.ProjectsRootNode$BadgingNode]" daemon prio=2 tid=0x07ab2800 nid=
0x1e84 in Object.wait() [0x0a49f000..0x0a49fd94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x1295fb88> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x1295fb88> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:CaretAwareJavaSourceTaskFactory worker/or
g.netbeans.api.java.source.support.CaretAwareJavaSourceTaskFactory$ComponentList
ener]" daemon prio=2 tid=0x07ab1000 nid=0x1eb8 in Object.wait() [0x0a29f000..0x0
a29fa14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x1295fbe0> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x1295fbe0> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:Default RequestProcessor/org.netbeans.spi
.java.project.support.ui.PackageRootNode]" daemon prio=2 tid=0x07aac800 nid=0x1e
a8 in Object.wait() [0x0a09f000..0x0a09fa94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x12889a00> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x12889a00> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:TimedSoftReference/org.openide.util.Timed
SoftReference]" daemon prio=2 tid=0x07aaa800 nid=0x1ea4 in Object.wait() [0x09e9
f000..0x09e9fb14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x127d7b70> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x127d7b70> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:Default RequestProcessor/org.netbeans.mod
ules.project.ui.ProjectsRootNode$BadgingNode]" daemon prio=2 tid=0x07aa9000 nid=
0x1ea0 in Object.wait() [0x09c9f000..0x09c9fb94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x127d7c10> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x127d7c10> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:JarFs - modification watcher/org.openide.
filesystems.JarFileSystem$2]" daemon prio=2 tid=0x0746ec00 nid=0x1e7c in Object.
wait() [0x09a9f000..0x09a9fc14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x127c2a70> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x127c2a70> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:JarFs - modification watcher/org.openide.
filesystems.JarFileSystem$2]" daemon prio=2 tid=0x0746d400 nid=0x1e70 in Object.
wait() [0x0989f000..0x0989fc94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x127c2ac8> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x127c2ac8> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:parsing-event-collector/org.netbeans.modu
les.parsing.impl.event.EventSupport$1]" daemon prio=2 tid=0x0746b000 nid=0x1e98
in Object.wait() [0x0969f000..0x0969fd14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x127c2b20> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x127c2b20> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:OpenIDE-request-processor-10/org.netbeans
.modules.parsing.spi.Scheduler$1]" daemon prio=2 tid=0x07aa4800 nid=0x1e94 in Ob
ject.wait() [0x0949f000..0x0949fd94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x127c2b78> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x127c2b78> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:Default RequestProcessor/org.netbeans.mod
ules.project.ui.ProjectsRootNode$BadgingNode]" daemon prio=2 tid=0x0742f000 nid=
0x1e90 in Object.wait() [0x0929f000..0x0929fa14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x127c2bd0> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x127c2bd0> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:RP for C:/work/Metro_YaJa/Netbeans/org.ne
tbeans.modules.mobility.project.classpath.J2MEClassPathProvider$1]" daemon prio=
2 tid=0x07a9e400 nid=0x1e38 in Object.wait() [0x0909f000..0x0909fa94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x1278a808> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x1278a808> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:SelectionAwareJavaSourceTaskFactory worke
r/org.netbeans.api.java.source.support.SelectionAwareJavaSourceTaskFactory$Compo
nentListener$1]" daemon prio=2 tid=0x07a98c00 nid=0x1e88 in Object.wait() [0x08e
9f000..0x08e9fb14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x1274d040> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x1274d040> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:Default RequestProcessor/null]" daemon pr
io=2 tid=0x07a76800 nid=0x1e80 in Object.wait() [0x08c9f000..0x08c9fb94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x126c1b30> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x126c1b30> (a java.lang.Object)

"Inactive RequestProcessor thread [Was:Default RequestProcessor/null]" daemon pr
io=2 tid=0x07a59400 nid=0x1e64 in Object.wait() [0x08a9f000..0x08a9fc14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x126932b0> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x126932b0> (a java.lang.Object)

"AWT-Windows" daemon prio=6 tid=0x040dc000 nid=0x1e00 runnable [0x0707f000..0x07
07fa14]
   java.lang.Thread.State: RUNNABLE
        at sun.awt.windows.WToolkit.eventLoop(Native Method)
        at sun.awt.windows.WToolkit.run(WToolkit.java:291)
        at java.lang.Thread.run(Thread.java:619)

"AWT-Shutdown" prio=6 tid=0x040ec400 nid=0x1df4 in Object.wait() [0x06e7f000..0x
06e7fa94]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11f34ce8> (a java.lang.Object)
        at java.lang.Object.wait(Object.java:485)
        at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
        - locked <0x11f34ce8> (a java.lang.Object)
        at java.lang.Thread.run(Thread.java:619)

"Java2D Disposer" daemon prio=10 tid=0x040a5800 nid=0x984 in Object.wait() [0x06
c7f000..0x06c7fb14]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11f34d78> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x11f34d78> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
        at sun.java2d.Disposer.run(Disposer.java:125)
        at java.lang.Thread.run(Thread.java:619)

"Inactive RequestProcessor thread [Was:Refresh Editor Context/org.netbeans.spi.d
ebugger.ui.EditorContextDispatcher$EventFirer]" daemon prio=2 tid=0x04075400 nid
=0x1610 in Object.wait() [0x0678f000..0x0678fc14]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11f2bc30> (a java.lang.Object)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java
:983)
        - locked <0x11f2bc30> (a java.lang.Object)

"Timer-0" daemon prio=6 tid=0x04070c00 nid=0xc60 in Object.wait() [0x0658f000..0
x0658fc94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11f2bca8> (a java.util.TaskQueue)
        at java.util.TimerThread.mainLoop(Timer.java:509)
        - locked <0x11f2bca8> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:462)

"CLI Requests Server" daemon prio=6 tid=0x0406d800 nid=0xc08 runnable [0x0638f00
0..0x0638fd14]
   java.lang.Thread.State: RUNNABLE
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
        - locked <0x11f2bd80> (a java.net.SocksSocketImpl)
        at java.net.ServerSocket.implAccept(ServerSocket.java:453)
        at java.net.ServerSocket.accept(ServerSocket.java:421)
        at org.netbeans.CLIHandler$Server.run(CLIHandler.java:1003)

"Active Reference Queue Daemon" daemon prio=2 tid=0x03fd3400 nid=0x8f4 in Object
.wait() [0x0430f000..0x0430fd94]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11f18d68> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x11f18d68> (a java.lang.ref.ReferenceQueue$Lock)
        at org.netbeans.modules.openide.util.ActiveQueue.run(ActiveQueue.java:53
)
        at java.lang.Thread.run(Thread.java:619)

"Low Memory Detector" daemon prio=6 tid=0x02ea6000 nid=0xbbc runnable [0x0000000
0..0x00000000]
   java.lang.Thread.State: RUNNABLE

"CompilerThread0" daemon prio=10 tid=0x02ea0800 nid=0x1de8 waiting on condition
[0x00000000..0x03b0f7bc]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" daemon prio=10 tid=0x02e9f000 nid=0xd78 runnable [0x00000000..
0x00000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x02e9dc00 nid=0x1dd8 waiting on conditio
n [0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=8 tid=0x02e8e000 nid=0x1d94 in Object.wait() [0x0350f000
..0x0350fc94]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11f18f98> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x11f18f98> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x02e89400 nid=0x1dd4 in Object.wait() [0
x0330f000..0x0330fd14]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x11f18c18> (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 <0x11f18c18> (a java.lang.ref.Reference$Lock)

"main" prio=6 tid=0x009e8800 nid=0x1d9c waiting on condition [0x00000000..0x0022
f290]
   java.lang.Thread.State: RUNNABLE

"VM Thread" prio=10 tid=0x02e85c00 nid=0x1dd0 runnable

"VM Periodic Task Thread" prio=10 tid=0x02eb0800 nid=0x1d7c waiting on condition


JNI global references: 2268

Heap
 def new generation   total 7936K, used 1594K [0x10040000, 0x108d0000, 0x11f0000
0)
  eden space 7104K,  31% used [0x10040000, 0x1026e2e0, 0x10730000)
  from space 832K,  99% used [0x10800000, 0x108cf908, 0x108d0000)
  to   space 832K,   0% used [0x10730000, 0x10730000, 0x10800000)
 tenured generation   total 104888K, used 101436K [0x11f00000, 0x1856e000, 0x290
40000)
   the space 104888K,  96% used [0x11f00000, 0x1820f260, 0x1820f400, 0x1856e000)

 compacting perm gen  total 48128K, used 48096K [0x29040000, 0x2bf40000, 0x35840
000)
   the space 48128K,  99% used [0x29040000, 0x2bf38308, 0x2bf38400, 0x2bf40000)
No shared spaces configured.




NOTE: I've found, that 6.7 does not freezes forever - since several minutes it shows a window "available items", than
freezes again.
Comment 3 vallej 2009-06-10 12:21:27 UTC
once more time for active thread:

"AWT-EventQueue-1" prio=6 tid=0x0410b400 nid=0x1d74 runnable [0x076bf000..0x076b
fd14]
   java.lang.Thread.State: RUNNABLE
        at java.lang.System.arraycopy(Native Method)
        at java.util.ArrayList.addAll(ArrayList.java:475)
        at org.netbeans.api.editor.settings.AttributesUtilities.createComposite(
AttributesUtilities.java:143)
        at org.netbeans.spi.editor.highlighting.support.OffsetsBag.merge(Offsets
Bag.java:656)
        at org.netbeans.spi.editor.highlighting.support.OffsetsBag.addHighlightI
mpl(OffsetsBag.java:496)
        at org.netbeans.spi.editor.highlighting.support.OffsetsBag.addHighlight(
OffsetsBag.java:161)
        - locked <0x1592eab8> (a org.netbeans.modules.editor.lib2.highlighting.O
ffsetGapList)
        at org.netbeans.modules.mobility.editor.ConfigurationHighlightsLayerFact
ory$BlocksHighlighting$2.run(ConfigurationHighlightsLayerFactory.java:156)
        at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1371)
        at org.netbeans.modules.mobility.editor.ConfigurationHighlightsLayerFact
ory$BlocksHighlighting.updateBags(ConfigurationHighlightsLayerFactory.java:147)
        at org.netbeans.modules.mobility.editor.DocumentPreprocessor.setLineList
(DocumentPreprocessor.java:162)
        at org.netbeans.modules.mobility.editor.DocumentPreprocessor.updateBlock
Chain(DocumentPreprocessor.java:203)
        at org.netbeans.modules.mobility.editor.DocumentPreprocessor$3.actionPer
formed(DocumentPreprocessor.java:176)
        at javax.swing.Timer.fireActionPerformed(Timer.java:271)
        at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.j
ava:104)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 4 vallej 2009-06-18 13:38:47 UTC
The issue is critical for me and (I believe) for any other j2me developer. Rolled back to NB 6.5.
Comment 5 vallej 2009-09-12 15:40:46 UTC
Sorry, I thought P5 is the highest priority.
Comment 6 Petr Suchomel 2009-09-14 11:05:02 UTC
I have not seen such behavior before. Please could you tell me:
- how big is the project (number of lines)
- are you using some network based storage
Comment 7 vallej 2009-09-14 11:29:23 UTC
I have not seen such behavior before. Please could you tell me:
- how big is the project (number of lines)

The project is very big (>2Mb of source files), but the issue can be reproduced even in a project with only one source
file with preprocessor directives. The issue is very noticeable when the file is bigger than 20kb. AND it is not
reproduceable if "Use preprocessor" checkbox is blank.

- are you using some network based storage
No, but I use WinXP. In Win7 the issue is less noticeable.
Comment 8 Petr Suchomel 2009-09-14 12:07:37 UTC
This sounds similar to http://www.netbeans.org/issues/show_bug.cgi?id=172136. How many lines have the single file?
Comment 9 vallej 2009-09-14 12:26:23 UTC
2029 lines/100 preprocessor blocks and 3100/20 preprocessor blocks, for example :-)
Comment 10 Andrei Chistiakov 2009-09-16 16:19:37 UTC
Product Version: NetBeans IDE 6.7.1 (Build 200907202301)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb)

To reproduce:
- open the attached project
- open pkg/GlobalWeatherSVGMIDlet.java in editor
- switch to source
- place cursor at the beginning of line 116
- type //#if and then press space bar. On my machine (Dual Core Opteron 2.4 GHz) IDE stuck for about 25 sec
- start entering a condition - IDE freezes for a while after each entered character


Comment 11 Andrei Chistiakov 2009-09-16 16:20:32 UTC
Created attachment 87783 [details]
Sample app to reproduce the issue
Comment 12 Petr Suchomel 2009-09-16 16:28:36 UTC
I am already have some local improvement to performance, but still in investigation of all bottlenecks.
Comment 13 Petr Suchomel 2009-09-17 14:43:56 UTC
*** Issue 172136 has been marked as a duplicate of this issue. ***
Comment 14 Petr Suchomel 2009-09-17 14:53:20 UTC
Fixed in CS cdd8d3661f8d
Comment 15 Petr Suchomel 2009-09-17 14:54:18 UTC
There is still issue with coloring - you need to close editor tab to get new color after change in options applied
Comment 16 Andrei Chistiakov 2009-09-18 11:39:26 UTC
*** Issue 170131 has been marked as a duplicate of this issue. ***
Comment 17 vnhjdh 2009-09-18 13:27:02 UTC
Impossible to work with NB when doing a mobile project!!!!

Is this going to be fixed any soon ???
Comment 18 Petr Suchomel 2009-09-18 13:59:17 UTC
Should be fixed in daily builds of 6.8 - could you verify? Unfortunately IMHO yesterday build is not available, so
please wait for next to get this fix. If you verify, I'll provide the module for 6.7 as well.
Comment 19 vallej 2009-09-18 14:03:59 UTC
Wow! Notify us when it will be ready, we will check it. Thanks!
Comment 20 Quality Engineering 2009-09-18 22:26:05 UTC
Integrated into 'main-golden', will be available in build *200909181401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/cdd8d3661f8d
User: psuchomel@netbeans.org
Log: Fix for #166843, j2me preprocessor freeze
Comment 21 vallej 2009-09-21 09:13:52 UTC
Confirmed fixed. Delay caused by printing "//#if some" decreased to 1-10 seconds (so there is still room to improvements).

Ande there are still small (~1-2sec) freezes while editing text in a huge preprocessor block.
Comment 22 Petr Suchomel 2009-09-21 09:23:46 UTC
I suspect, these delays are caused by repainting the background colors. Vito, could you look at it?
Comment 23 vnhjdh 2009-09-22 13:37:41 UTC
Delays are happening for me all the time - not just when in the start of typing //# something.

Some of my variables (preprocessor based) has a red line but there is nothing wrong with them and I kan compile?

This is not a P3 - this is a P1

Comment 24 Petr Suchomel 2009-09-22 13:49:07 UTC
Did you try the fresh build please?
Comment 25 vallej 2009-09-22 13:59:14 UTC
In the latest build this issue was fixed, but vnhjdh said true - there are still a very noticeable delays while editing
code inside a preprocessor block.

"Red lines" caused by wrong analysing of preprocessored code, but it is a floating error (ANOTHER bug) which I'm unable
to describe. 

btw, I have CPU Code2duo E8400.
Comment 26 Vitezslav Stejskal 2009-09-22 16:13:01 UTC
In dev builds you can use Profile Me! to generate profiler snapshots while working in the IDE. Freezes/slowdowns should
be visible in the snapshot. Attach the snapshot here.
Comment 27 Vitezslav Stejskal 2009-09-22 16:14:01 UTC
Profile Me description/example - http://wiki.netbeans.org/GenerateThreadDump
Comment 28 vallej 2009-09-22 17:09:36 UTC
Created attachment 88134 [details]
editing in huge preprocessor block
Comment 29 vnhjdh 2009-09-23 14:42:17 UTC
Latest build makes no different - delays the same.
Comment 30 vnhjdh 2009-09-23 17:24:59 UTC
Latest build makes no different - delays the same.
Comment 31 vnhjdh 2009-09-24 10:30:08 UTC
Created attachment 88264 [details]
editor freeze - a profile snapshot
Comment 32 Vitezslav Stejskal 2009-09-29 14:44:49 UTC
org.netbeans.modules.mobility.editor.DocumentPreprocessor forces repainting of the whole (!) document after every
modification.
Comment 33 Petr Suchomel 2009-10-01 15:00:36 UTC
Removed unnecessary repaint, should be fixed in http://hg.netbeans.org/main/rev/6ac7c5ba4c3c
Comment 34 Quality Engineering 2009-10-09 23:03:11 UTC
Integrated into 'main-golden', will be available in build *200910091401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6ac7c5ba4c3c
User: psuchomel@netbeans.org
Log: Additional fix for #166843, j2me preprocessor freeze (removed unnecessary repaint
Comment 35 vnhjdh 2009-10-10 17:55:03 UTC
issue NOT fixed in 200910091401.
Comment 36 Lukas Hasik 2009-10-10 21:15:24 UTC
@vnhjdh If it is not fixed and you are able to reproduce it we need another profiler snapshot or at least thread dump if
IDE locks. Vstejskal mentioned it already - http://wiki.netbeans.org/GenerateThreadDump

Anyway, messages as "not fixed" don't help. Be more specific - what is exactly the problem, any additional info helps.
Thank you
Comment 37 vnhjdh 2009-10-10 22:22:13 UTC
Created attachment 89270 [details]
Snapshot of new nightly develop version
Comment 38 vnhjdh 2009-10-13 17:21:35 UTC
Why is this bug set as fixed - it is not fixed in latest build ??? 

This is a big problem for me - especially "large" files 10000-15000 lines. 
Comment 39 vallej 2009-10-18 10:01:28 UTC
I don't know why, but there are no freezings while editing code in a preprocessor block in Windows 7, there are only
annoying background splashes (ex.: background is pink, press any key => background is white => in 0.5 sec background is
pink again. It's very pacificationly when you are in non-stop typing ;-)
Comment 40 Petr Suchomel 2009-10-20 17:24:14 UTC
I think I have really final solution to it. Here is compiled module to test with.
Comment 41 Petr Suchomel 2009-10-20 17:26:14 UTC
Created attachment 89788 [details]
org-netbeans-modules-mobility-editor.jar
Comment 42 Lukas Hasik 2009-10-20 22:14:40 UTC
vallej, vnhjdh, we need your help. 
Could you please try the attached jar? You will have to save it into your NB installation directory. Please, keep the
origin jar in safe location to be able to recover (and don't test it on production code or make a copy).
thank you
Comment 43 vnhjdh 2009-10-20 23:17:01 UTC
Created attachment 89808 [details]
Snapshot of new module
Comment 44 vnhjdh 2009-10-20 23:18:10 UTC
Created attachment 89809 [details]
Log messages file from use of new module
Comment 45 vnhjdh 2009-10-20 23:20:10 UTC
Still the same on my setup.
Comment 46 vallej 2009-10-21 09:04:08 UTC
Created attachment 89823 [details]
with replaced org-netbeans-modules-mobility-editor.jar
Comment 47 vallej 2009-10-21 09:04:40 UTC
With attached jar I see some changes (sometimes it's possible to type up to 5 symbols without any freeze while typing),
but it's still not acceptable. Snapshot attached.
Comment 48 Petr Suchomel 2009-10-21 10:39:09 UTC
I suspect, at least the flickering when typing should be gone, right?
Comment 49 vallej 2009-10-21 10:45:32 UTC
I don't know yet. I tested it in WinXP.
Comment 50 Petr Suchomel 2009-10-21 17:37:17 UTC
I expect, flickering should be gone with this CS 39d4f1dabf0e
Comment 51 Quality Engineering 2009-10-22 23:43:53 UTC
Integrated into 'main-golden', will be available in build *200910221401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6500840ccf8f
User: psuchomel@netbeans.org
Log: Improved behaviour with issue #166843, the flickering is gone now
Comment 52 vnhjdh 2009-11-17 05:17:31 UTC
I see no progress on this top priority issue that makes mobile development with netbeans a living hell!!!!!!!!!!!!!
Comment 53 vallej 2009-11-19 06:45:46 UTC
Created attachment 91341 [details]
New profiler snapshot with latest updates
Comment 54 vallej 2009-11-19 06:46:40 UTC
(still sucks in PP blocks)
Comment 55 aste 2009-11-27 00:27:57 UTC
If there is too hard fix this performance  problem, may it to be possible make options flag for disabling preprocessor's block analizing in editor?

Becouse preprocessor need in j2me projects, but now have acceptable performance possible only with turnrd off preprocessor option on project level. There is very uncomfortable.
Comment 56 vnhjdh 2009-11-27 05:43:40 UTC
Not an option. If this P1 issue doesn't get fixed, the mobile module is dead.
Comment 57 Petr Suchomel 2009-11-27 07:57:03 UTC
Sorry to hear that - I am really trying to get this reproduced, but I do not see issues previously reported. If you can attach more nps snap shoots, it would be great, because it will help me to narrow down the root cause. Thanks.
Comment 58 vallej 2009-11-27 09:35:10 UTC
Created attachment 91791 [details]
Another example to reproduce the issue

I'm unable to believe that anyone has any troubles with reproducing the issue. Install fresh netbeans over WinXP, open MainCanvas file from example and notice the GREAT SLOWNESS.
Comment 59 vnhjdh 2009-11-27 15:28:46 UTC
Created attachment 91805 [details]
Slow editor with lastest build

I noticed that the memory counter is quite active. Is a lot of objects allocated instead of reused? Maybe GC is called all the time.

Make sure you don't have a custom setup with extra heap or something like that. I'm also running windows xp.
Comment 60 vallej 2009-11-30 01:27:00 UTC
Custom memory settings doesn't influence to the issue (I've checked), but allowing netbeans use more memory is a good practice, I feel so.
Comment 61 Andrei Chistiakov 2009-12-02 06:45:06 UTC
Product Version: NetBeans IDE 6.8 RC1 (Build 200911252200)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb)

Petr,
With this build the issue is well reproducible for me by following steps described in comment #10.
Comment 62 Vitezslav Stejskal 2009-12-07 06:57:36 UTC
http://hg.netbeans.org/jet-main/rev/e516cb1692c5
Comment 63 Vitezslav Stejskal 2009-12-07 06:58:13 UTC
*** Bug 175842 has been marked as a duplicate of this bug. ***
Comment 64 aste 2009-12-07 07:24:45 UTC
Sorry, where and when will be possible download and verify version of netbeans with this fix?
I right understand that DEFECT WILL BE NOT FIXED IN 6.8?
6.8RC unusable for J2ME projects bith this BUG..
Comment 65 aste 2009-12-07 08:58:18 UTC
Is there possible change target release from 6.9 to 6.8?
becouse 6.9 not available now for work, work with 6.7 and 6.8 impossible with this bug...
too long time wait for 6.9 :-(
Comment 66 Vitezslav Stejskal 2009-12-07 10:15:13 UTC
(In reply to comment #65)
> Is there possible change target release from 6.9 to 6.8?

No, it's not, sorry. 6.8 is almost released.


> becouse 6.9 not available now for work, work with 6.7 and 6.8 impossible with
> this bug...
> too long time wait for 6.9 :-(

If the fix works we will include it in 6.8 patch, so you won't have to wait for the next big release.
Comment 67 Vitezslav Stejskal 2009-12-07 10:17:08 UTC
(In reply to comment #64)
> Sorry, where and when will be possible download and verify version of netbeans
> with this fix?

Please monitor this issue and wait for a notification from 'Quality Engineering'.
Comment 68 Quality Engineering 2009-12-10 02:26:38 UTC
Integrated into 'main-golden', will be available in build *200912100200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e516cb1692c5
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #166843: fixing inefficient j2me preprocessor highlighting layers
Comment 69 vnhjdh 2009-12-10 10:08:09 UTC
Delay is now not seen in most files, but still in some. The files that has delays when typing, the delay may be several sec. This issue may by related to Bug 174320.

Testet on NetBeans Dev 200912100200.
Comment 70 aste 2009-12-10 14:32:45 UTC
Created attachment 92396 [details]
snapshots (thread dumps) 

thread dumps..
IDE was frosen for frw seconds and CPU had 100% loading while processing J2ME source file (2616 lines) while typing comment line 
dumps was created few seconds later after i press "take snapshot button" in toolbar
Comment 71 aste 2009-12-10 14:44:38 UTC
I try Testet on NetBeans Dev 200912100200...
I attach two thread dumps.. IDE was frozen for few seconds while i type comment line in large J2ME file (around 2600 lines)..


After switching off  preprocessor in project settings all work fine...
With turned off preprocessor i can use NetBeans on Netbook with Atom, and with turned on preprocessor there is impossible use NetBeans in Core2Duo 2GHz...

I have very simple way for resolve this problem..
Need do two manual commands for recomment preprocessor blocks with turned off preprocessor option in project (one for recomment current file, other - for recomment whole project).

This version DO NOT not resolved DEFECT.. :-(
Comment 72 vallej 2009-12-11 05:16:17 UTC
aste, are you sure it hadn't been fixed? I've downloaded build 200912101400 and found it works properly, at least there are no freezings in PP code now.
Comment 73 aste 2009-12-11 06:43:19 UTC
(In reply to comment #72)
> aste, are you sure it hadn't been fixed? I've downloaded build 200912101400 and
> found it works properly, at least there are no freezings in PP code now.

How many lines count J2ME file in your test?
I try with my really project.. May be it's work slyghtly better.. can't say..
But when i type some text, it's displayed by portions with freesed pauses between its..

I work with large project with few classes which counts around 1500-2600 lines each.. and set simple classes.. when I edit small file - problem is absent.. 
when I edit large file, espeshially when i work on battery problem present...
And i have also two linked projects with shared classes..

I send yesterday two memory dumps from build 200912100200.. There is set of threads wich 100% loading...

But turning off preprocessing in project settings heal netbeans immediatelly...
Comment 74 vallej 2009-12-11 06:55:30 UTC
Oh, I've understand - the issue still present for huge files, but the improvement is very noticeable and there are no freezings for the small ones. 

(I've checked my files with 2k and 3k lines)
Comment 75 aste 2009-12-11 08:55:11 UTC
(In reply to comment #74)
> Oh, I've understand - the issue still present for huge files, but the
> improvement is very noticeable and there are no freezings for the small ones. 
> 
> (I've checked my files with 2k and 3k lines)

Yes, its depend from file size, from CPU speed, and IMHO from preprocessor directives number also..
Comment 76 aste 2010-01-08 00:49:36 UTC
If it such difficult for optimization please do one simple modification:
-possibility of turning off preprocessor directives analizing in editor (in options tab or in configuration file) independent from "preprocessor" option in projevct level 
-manual command for recomment preprocessor blocks for all files project
Comment 77 vnhjdh 2010-01-10 13:23:06 UTC
Why is nothing happening on this issue + related mobility editor bugs???

Is nobody working on the mobility module anymore???
Comment 78 aste 2010-01-23 05:17:23 UTC
WHEN THIS BUG WILL BE FIXED?
Comment 79 int21h 2010-02-03 18:02:53 UTC
This bug is very annoying. On large source-code files makes it virtually impossible to edit (when preprocessor is used). Even on not that big files the typing experience is very poor. Surprised to see that on 6.8, because 6.5 version didn't have this issue.
Comment 80 marbed 2010-02-04 01:28:02 UTC
Created attachment 93832 [details]
org-netbeans-modules-mobility-editor.jar

This is version compliled from sources netbeans-6.8-200912091457-src. The problem is in block background highlighting.
Comment 81 marbed 2010-02-04 01:42:25 UTC
Please go to DocumentPreprocessor and in setLineList(NbEditorDocument,ArrayList<PPLine>) method comment line:
blockLayer.updateBags();
When backbround highlighting is disable now huge files (>5000 lines) works perfectly (ubuntu 9.10, NB 6.8)

Best regards.
Comment 82 marbed 2010-02-04 07:03:32 UTC
(In reply to comment #25)
> In the latest build this issue was fixed, but vnhjdh said true - there are
> still a very noticeable delays while editing
> code inside a preprocessor block.
> 
> "Red lines" caused by wrong analysing of preprocessored code, but it is a
> floating error (ANOTHER bug) which I'm unable
> to describe. 
> 
> btw, I have CPU Code2duo E8400.

This bug is annoying too. What is id of this bug?
Comment 83 aste 2010-02-11 20:58:30 UTC
(In reply to comment #81)
> Please go to DocumentPreprocessor and in
> setLineList(NbEditorDocument,ArrayList<PPLine>) method comment line:
> blockLayer.updateBags();
> When backbround highlighting is disable now huge files (>5000 lines) works
> perfectly (ubuntu 9.10, NB 6.8)
> 
> Best regards.

After last update of netbeans (help/check for updates) problem has not been fixed...
where i can take sources of  DocumentPreprocessor and what Netbeans module need to be replaces with modified DocumentPreprocessor?
Comment 84 marbed 2010-02-13 05:18:33 UTC
> After last update of netbeans (help/check for updates) problem has not been
> fixed...

My fixed module and source changes are not present in official updates. This is not finally solution - this is first step only..

> where i can take sources of  DocumentPreprocessor and what Netbeans module need
> to be replaces with modified DocumentPreprocessor?

Try my fixed module (org-netbeans-modules-mobility-editor.jar):

http://netbeans.org/bugzilla/attachment.cgi?id=93832

Please download this jar and replace in ../netbeans-6.8/mobility8/modules/

Backbround block highlighting is not available but performance is much better.
Comment 85 aste 2010-02-18 06:24:21 UTC
(In reply to comment #84)
> > After last update of netbeans (help/check for updates) problem has not been
> > fixed...
> 
> My fixed module and source changes are not present in official updates. This is
> not finally solution - this is first step only..
> 
> > where i can take sources of  DocumentPreprocessor and what Netbeans module need
> > to be replaces with modified DocumentPreprocessor?
> 
> Try my fixed module (org-netbeans-modules-mobility-editor.jar):
> 
> http://netbeans.org/bugzilla/attachment.cgi?id=93832
> 
> Please download this jar and replace in ../netbeans-6.8/mobility8/modules/
> 
> Backbround block highlighting is not available but performance is much better.


Thanks, I tried it.. Result is not good... I think, it may be is a little bit faster than standard version.. But real work is also impossible with turned on preprocessor..
Editor is freeze when i faster type some text and processor utilization is 100%..
I thing there need try turn off all preprocessor commands processing in editor.. 




Editing file size ~2800 lines

MS Windows XP SP3, Core2Duo 2GHz, 3Gb RAM
Comment 86 estevan.diedrich 2010-03-17 15:09:07 UTC
(In reply to comment #84)
> > After last update of netbeans (help/check for updates) problem has not been
> > fixed...
> 
> My fixed module and source changes are not present in official updates. This is
> not finally solution - this is first step only..
> 
> > where i can take sources of  DocumentPreprocessor and what Netbeans module need
> > to be replaces with modified DocumentPreprocessor?
> 
> Try my fixed module (org-netbeans-modules-mobility-editor.jar):
> 
> http://netbeans.org/bugzilla/attachment.cgi?id=93832
> 
> Please download this jar and replace in ../netbeans-6.8/mobility8/modules/
> 
> Backbround block highlighting is not available but performance is much better.

I'm using your jar but the VMD is much slow yet.
I'm not using preprocessor on my jme project, still the VMD is much slow yet.
This thread is same as https://netbeans.org/bugzilla/show_bug.cgi?id=165866 ?.

thanks.
Comment 87 estevan.diedrich 2010-03-17 15:47:11 UTC
(In reply to comment #86)
> (In reply to comment #84)
> > > After last update of netbeans (help/check for updates) problem has not been
> > > fixed...
> > 
> > My fixed module and source changes are not present in official updates. This is
> > not finally solution - this is first step only..
> > 
> > > where i can take sources of  DocumentPreprocessor and what Netbeans module need
> > > to be replaces with modified DocumentPreprocessor?
> > 
> > Try my fixed module (org-netbeans-modules-mobility-editor.jar):
> > 
> > http://netbeans.org/bugzilla/attachment.cgi?id=93832
> > 
> > Please download this jar and replace in ../netbeans-6.8/mobility8/modules/
> > 
> > Backbround block highlighting is not available but performance is much better.
> 
> I'm using your jar but the VMD is much slow yet.
> I'm not using preprocessor on my jme project, still the VMD is much slow yet.
> This thread is same as https://netbeans.org/bugzilla/show_bug.cgi?id=165866 ?.
> 
> thanks.

This thread have some thing about that http://forums.netbeans.org/post-64144.html ?
Comment 88 aste 2010-03-18 07:22:54 UTC
Someone from Netbeans team can write there why this bug not fixed for such long time as it has been detected?

If it such heavy to fix performance, please simple make possibility turning off preprocessing directives analizing in  editor, and commands for manual re-comment
preprocessor blocks for whole project...

There IMPOSSIBLE work with java preproceessor in Netbeans IDE!!!!!
Comment 89 estevan.diedrich 2010-03-19 20:27:31 UTC
(In reply to comment #88)
> Someone from Netbeans team can write there why this bug not fixed for such long
> time as it has been detected?
> 
> If it such heavy to fix performance, please simple make possibility turning off
> preprocessing directives analizing in  editor, and commands for manual
> re-comment
> preprocessor blocks for whole project...
> 
> There IMPOSSIBLE work with java preproceessor in Netbeans IDE!!!!!

I'm not using preprocessor on my jme project, still the VMD is much slow yet.
See my problem description at https://netbeans.org/bugzilla/show_bug.cgi?id=165866
Comment 90 baldur 2010-03-21 03:33:31 UTC
I've noticed, that in DocumentPreprocessor.java (in module mobility.editor) there's a delay of 200ms to start the Preprocessor (restartTimer(), line 181).
If I'm right, the Preprocessor starts 200ms each time after we changed the source code. I think this value is much too short for normal typing, I would suggest to use a value of at least 1000ms. 5 seconds would be enough, too. I don't need the preprocessor blocks being updated in realtime.

Currently, working with large J2ME Code-files is painful slow, even if there are no preprocessor blocks in a file. But after the preprocessor was disabled, everything works fine.
The preprocessor should check, if there are any //# lines in the code, before it starts doing it's work (repainting and whatever it does)
Comment 91 Andrei Chistiakov 2010-03-22 13:40:32 UTC
Created attachment 95531 [details]
Build 201003220200. Snapshot is taken while typing //#if ABC
Comment 92 Andrei Chistiakov 2010-03-22 13:48:41 UTC
Created attachment 95533 [details]
Build 201003220200. Snapshot is taken while typing within //#if - //#endif block
Comment 93 estevan.diedrich 2010-03-22 14:33:17 UTC
Created attachment 95538 [details]
Even without preprocessor is impossible use VMD.

Even without preprocessor is impossible use VMD. Becouse when i make a change in graph my cpu usage goes to 100%.
Comment 94 estevan.diedrich 2010-03-22 15:44:15 UTC
(In reply to comment #93)
> Created an attachment (id=95538) [details]
> Even without preprocessor is impossible use VMD.
> 
> Even without preprocessor is impossible use VMD. Becouse when i make a change
> in graph my cpu usage goes to 100%.
This problem is reported at:

http://statistics.netbeans.org/analytics/exception.do?id=357061

[]'s
Comment 95 estevan.diedrich 2010-03-24 15:52:39 UTC
(In reply to comment #94)
> (In reply to comment #93)
> > Created an attachment (id=95538) [details] [details]
> > Even without preprocessor is impossible use VMD.
> > 
> > Even without preprocessor is impossible use VMD. Becouse when i make a change
> > in graph my cpu usage goes to 100%.
> This problem is reported at:
> 
> http://statistics.netbeans.org/analytics/exception.do?id=357061
> 
> []'s

There are some way to change the org.netbeans.modules.visual.router.OrthogonalSearchRouter to org.netbeans.api.visual.router.RouterFactory.createDirectRouter() as proposed at http://forums.netbeans.org/post-64144.html ?

This change possibly would solve the problem.

thanks
Comment 96 estevan.diedrich 2010-04-01 14:38:57 UTC
Name: AWT-EventQueue-1
State: RUNNABLE
Total blocked: 1.261  Total waited: 24.610

Stack trace: 
java.util.AbstractList$Itr.hasNext(AbstractList.java:339)
org.netbeans.modules.visual.router.OrthogonalSearchRouterRegion.parseSubRegions(OrthogonalSearchRouterRegion.java:235)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:197)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:222)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:222)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:222)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:229)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:222)
org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.route(OrthogonalSearchRouterCore.java:107)
org.netbeans.modules.visual.router.OrthogonalSearchRouter.routeConnection(OrthogonalSearchRouter.java:163)
org.netbeans.api.visual.widget.ConnectionWidget.calculateRouting(ConnectionWidget.java:527)
org.netbeans.modules.visual.layout.ConnectionWidgetLayout.layout(ConnectionWidgetLayout.java:109)
org.netbeans.api.visual.widget.Widget.layout(Widget.java:1350)
org.netbeans.api.visual.widget.Widget.layout(Widget.java:1342)
org.netbeans.api.visual.widget.LayerWidget.layout(LayerWidget.java:86)
org.netbeans.api.visual.widget.Widget.layout(Widget.java:1342)
org.netbeans.api.visual.widget.Scene.layoutScene(Scene.java:315)
org.netbeans.api.visual.widget.Scene.validate(Scene.java:396)
org.netbeans.api.visual.widget.SceneComponent.setBounds(SceneComponent.java:117)
java.awt.Component.resize(Component.java:1906)
   - locked java.awt.Component$AWTTreeLock@a6febb
java.awt.Component.setSize(Component.java:1895)
java.awt.Component.resize(Component.java:1929)
java.awt.Component.setSize(Component.java:1920)
javax.swing.JViewport.setViewSize(JViewport.java:1038)
javax.swing.ViewportLayout.layoutContainer(ViewportLayout.java:183)
java.awt.Container.layout(Container.java:1432)
java.awt.Container.doLayout(Container.java:1421)
java.awt.Container.validateTree(Container.java:1519)
java.awt.Container.validateTree(Container.java:1526)
java.awt.Container.validate(Container.java:1491)
   - locked java.awt.Component$AWTTreeLock@a6febb
javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:635)
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:127)
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:125)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 97 baldur 2010-04-01 22:54:08 UTC
I have logged the activity of DocumentPreprocessor and found an interesting problem.
The J2MEDataObject.J2MEEditorSupprt class creates a DocumentPreprocessor, which listens to the currently active document. It's using the EditorRegistry to hook it's listener into the next active document, if the user switches the editor tab.
When I'm working with multiple J2ME files, EACH J2MEDataObject creates a DocumentPeprocessor and ALL of their listeners hooks into the same document. When working with a single document, everything is OK. But when working with 20 J2ME documents, I get 20 callbacks from the DocumentListener and the proprocessor is invoked 20 times at the same time, and working with java files becomes horrible slow.

For a "quick fix", I changed the DocumentPreprocessor object of J2MEDataObject (J2MEDataObject.java, line 180) into a static object, so there's only one global listener, but there should be a better solution.
Comment 98 estevan.diedrich 2010-04-01 23:06:20 UTC
(In reply to comment #97)
> I have logged the activity of DocumentPreprocessor and found an interesting
> problem.
> The J2MEDataObject.J2MEEditorSupprt class creates a DocumentPreprocessor, which
> listens to the currently active document. It's using the EditorRegistry to hook
> it's listener into the next active document, if the user switches the editor
> tab.
> When I'm working with multiple J2ME files, EACH J2MEDataObject creates a
> DocumentPeprocessor and ALL of their listeners hooks into the same document.
> When working with a single document, everything is OK. But when working with 20
> J2ME documents, I get 20 callbacks from the DocumentListener and the
> proprocessor is invoked 20 times at the same time, and working with java files
> becomes horrible slow.
> 
> For a "quick fix", I changed the DocumentPreprocessor object of J2MEDataObject
> (J2MEDataObject.java, line 180) into a static object, so there's only one
> global listener, but there should be a better solution.

Good job Baldur, can you send me a copy of the jar with your changes ?
My problem is another but possibly your changes can help me too.

thank you.
Comment 99 marbed 2010-04-02 11:09:20 UTC
(In reply to comment #98)
> (In reply to comment #97)
> > I have logged the activity of DocumentPreprocessor and found an interesting
> > problem.
> > The J2MEDataObject.J2MEEditorSupprt class creates a DocumentPreprocessor, which
> > listens to the currently active document. It's using the EditorRegistry to hook
> > it's listener into the next active document, if the user switches the editor
> > tab.
> > When I'm working with multiple J2ME files, EACH J2MEDataObject creates a
> > DocumentPeprocessor and ALL of their listeners hooks into the same document.
> > When working with a single document, everything is OK. But when working with 20
> > J2ME documents, I get 20 callbacks from the DocumentListener and the
> > proprocessor is invoked 20 times at the same time, and working with java files
> > becomes horrible slow.
> > 
> > For a "quick fix", I changed the DocumentPreprocessor object of J2MEDataObject
> > (J2MEDataObject.java, line 180) into a static object, so there's only one
> > global listener, but there should be a better solution.
> 
> Good job Baldur, can you send me a copy of the jar with your changes ?
> My problem is another but possibly your changes can help me too.
> 
> thank you.

I found some solution. This is my "quick fix":

In DocumentPreprocessor.java i changed this function:

    private boolean isPreprocessorStarted;
    private long timeLastInvoke;

    /** Restart the timer which starts the parser after the specified delay.*/
    void restartTimer() {
      timeLastInvoke = System.currentTimeMillis();
      if (isPreprocessorStarted)
      {
        return;
      }
//        if (timerTask != null) {  // initialize timer
//            timerTask.cancel();
//        }

        isPreprocessorStarted = true;
        timerTask = new TimerTask(){
            @Override
            public void run() {
              long _timeNow = System.currentTimeMillis();
              if (_timeNow - timeLastInvoke > 2000)
              {
                JTextComponent component = EditorRegistry.focusedComponent();
                if (component != null) {
                    DocumentPreprocessor.updateBlockChain((NbEditorDocument) component.getDocument());
                }
                isPreprocessorStarted = false;
              }
              else
              {
                isPreprocessorStarted = false;
                timerTask.cancel();
                restartTimer();
              }
            }
        };

       timer.schedule(timerTask, 3000);
    }

Now preprocessor works several seconds after last user's action.
Comment 100 marbed 2010-04-02 11:13:20 UTC
Created attachment 96585 [details]
fixed org-netbeans-modules-mobility-editor.jar

This is fixed org-netbeans-modules-mobility-editor.jar (preprocessor works after last users's action)
Comment 101 aste 2010-04-07 10:12:29 UTC
(In reply to comment #100)
> Created an attachment (id=96585) [details]
> fixed org-netbeans-modules-mobility-editor.jar
> 
> This is fixed org-netbeans-modules-mobility-editor.jar (preprocessor works
> after last users's action)

This fix look wery well :-) Performance on my files with turned on preprocessor commonly OK with this fix.. Now i can work with activated preprocessor.

But there was two little problems - one or two times by week performance was degraded to very poor level (as with old version) abut it was be healed  by restarting IDE and incrementing initial memory size in Netbeans configuration file.

And few times when Netbeans was started editor was blocked (IDE was not been frosen, menu was active, but after type some text it not was displayed, but IDE count file as changed.. This bug was ocupied only when  IDE was started..
If IDE after start work OK, this bug not detected in this session.
Comment 102 aste 2010-04-08 06:56:54 UTC
preprocessor performance degrading return wnen i turn off hyperthreading in BIOS..
with fix it's look better then without it, but slowly than work with turnrd off preprocessor option..
resume - this fix is good, but not radically good :-(
I again want to offer idea with manual preprocessor mode (can be switched from command line parameters in netbeans.conf for example)
becouse without preporocessor IDE "fly" even atom processor in energy saved mode...
in "manual" preprocessor mode preprocessor directives can analize and re-comment by user request from menu (this menu item present in menu now), and before saving file..
Comment 103 aste 2010-06-05 05:54:41 UTC
Download and try Netbeans 6.9 RC2
THIS BUG IS DON'T FIXED IN THIS RELEASE!

WHEN THIS BUG WILL BE FIXED?
Comment 104 Petr Suchomel 2010-06-05 19:52:25 UTC
Please can you add thread dump? That's something strange, but I will look at this immediately.
Comment 105 Petr Suchomel 2010-06-07 11:51:50 UTC
Please can you add some more information:
- how many blocks is the maximum?
- can you when was two weeks ago, when performance went down?
I am not really able to reproduce issue, with 5000+ blocks, performance is worse, but not blocking (typing is OK, deletes are a bit slower)
Comment 106 vallej 2010-06-07 11:55:21 UTC
Freezings are fixed, correct. But overall perfomance is still REALLY AWFUL.
Comment 107 baldur 2010-06-07 12:22:58 UTC
(In reply to comment #105)
> Please can you add some more information:
> - how many blocks is the maximum?
> - can you when was two weeks ago, when performance went down?
> I am not really able to reproduce issue, with 5000+ blocks, performance is
> worse, but not blocking (typing is OK, deletes are a bit slower)

Did you have tested the performance with a large number of (J2ME-) Java Files opened?
As I described above, the Performance goes down, if more files are opened, because the DocumentPreprocessor class puts a listener into the active document for each opened Java file.
Comment 108 aste 2010-06-07 13:29:42 UTC
Created attachment 99863 [details]
archived snapshots with freezed editor 

archive with 4 snapshot attached..
but wnen i press "take snapshot button" snapshot window was activatet only AFTER unfreeze editor..
yea, commonly i have many opened files in editor and fwe files commonly is large..
and i want say again - with turned off preprocessor - performance is good.

if this problem such difficult for resolve, why you do not wand turn off preprocessor analizing in editor?

there is possible do analize and recomment before files will saved to disk and in addition by malual "recomment" command.
Comment 109 Petr Suchomel 2010-06-08 12:56:17 UTC
(In reply to comment #107)
> (In reply to comment #105)
> > Please can you add some more information:
> > - how many blocks is the maximum?
> > - can you when was two weeks ago, when performance went down?
> > I am not really able to reproduce issue, with 5000+ blocks, performance is
> > worse, but not blocking (typing is OK, deletes are a bit slower)
> 
> Did you have tested the performance with a large number of (J2ME-) Java Files
> opened?
> As I described above, the Performance goes down, if more files are opened,
> because the DocumentPreprocessor class puts a listener into the active document
> for each opened Java file.

Yes, but until you start modifying the document, there are no changes (the window is not activated), so far this should not cause additional slow downs.
Comment 110 Petr Suchomel 2010-06-08 12:58:08 UTC
(In reply to comment #108)
> Created an attachment (id=99863) [details]
> archived snapshots with freezed editor 
> 
> archive with 4 snapshot attached..
> but wnen i press "take snapshot button" snapshot window was activatet only
> AFTER unfreeze editor..
> yea, commonly i have many opened files in editor and fwe files commonly is
> large..
> and i want say again - with turned off preprocessor - performance is good.
> 
> if this problem such difficult for resolve, why you do not wand turn off
> preprocessor analizing in editor?
> 
> there is possible do analize and recomment before files will saved to disk and
> in addition by malual "recomment" command.

Please, can you take snaphot using VisualVM? Use Java VisualVM (jvisualvm.exe)in /bin folder of your JDK distribution, attach to NetBeans and take thread dump regardless of NB state.
Comment 111 Petr Suchomel 2010-06-08 13:07:01 UTC
(In reply to comment #110)
> (In reply to comment #108)
> > Created an attachment (id=99863) [details] [details]
> > archived snapshots with freezed editor 
> > 
> > archive with 4 snapshot attached..
> > but wnen i press "take snapshot button" snapshot window was activatet only
> > AFTER unfreeze editor..
> > yea, commonly i have many opened files in editor and fwe files commonly is
> > large..
> > and i want say again - with turned off preprocessor - performance is good.
> > 
> > if this problem such difficult for resolve, why you do not wand turn off
> > preprocessor analizing in editor?
> > 
> > there is possible do analize and recomment before files will saved to disk and
> > in addition by malual "recomment" command.
> 
> Please, can you take snaphot using VisualVM? Use Java VisualVM
> (jvisualvm.exe)in /bin folder of your JDK distribution, attach to NetBeans and
> take thread dump regardless of NB state.

I was looking at snapshots, unfortunately nothing related to preprocessor at all. Probably the snapshot was taken after unfreeze - please look at the option of using VisualVM to take thread dump.
Comment 112 baldur 2010-06-08 13:16:43 UTC
(In reply to comment #109)
> (In reply to comment #107)
> > (In reply to comment #105)
> > > Please can you add some more information:
> > > - how many blocks is the maximum?
> > > - can you when was two weeks ago, when performance went down?
> > > I am not really able to reproduce issue, with 5000+ blocks, performance is
> > > worse, but not blocking (typing is OK, deletes are a bit slower)
> > 
> > Did you have tested the performance with a large number of (J2ME-) Java Files
> > opened?
> > As I described above, the Performance goes down, if more files are opened,
> > because the DocumentPreprocessor class puts a listener into the active document
> > for each opened Java file.
> 
> Yes, but until you start modifying the document, there are no changes (the
> window is not activated), so far this should not cause additional slow downs.

In DocumentPreprocessor.java, Line 143 (in the mobility.editor module) the DocumentListener is attached to the active document. So, if I'm working with 20 j2me files, I get 20 listeners on my active document. If you put a log message into restartTimer (line 179), you will see, updateBlockChain will be invoked multiple times when working on the document, one time for each opened document.
Comment 113 Petr Suchomel 2010-06-08 14:27:41 UTC
(In reply to comment #112)
> (In reply to comment #109)
> > (In reply to comment #107)
> > > (In reply to comment #105)
> > > > Please can you add some more information:
> > > > - how many blocks is the maximum?
> > > > - can you when was two weeks ago, when performance went down?
> > > > I am not really able to reproduce issue, with 5000+ blocks, performance is
> > > > worse, but not blocking (typing is OK, deletes are a bit slower)
> > > 
> > > Did you have tested the performance with a large number of (J2ME-) Java Files
> > > opened?
> > > As I described above, the Performance goes down, if more files are opened,
> > > because the DocumentPreprocessor class puts a listener into the active document
> > > for each opened Java file.
> > 
> > Yes, but until you start modifying the document, there are no changes (the
> > window is not activated), so far this should not cause additional slow downs.
> 
> In DocumentPreprocessor.java, Line 143 (in the mobility.editor module) the
> DocumentListener is attached to the active document. So, if I'm working with 20
> j2me files, I get 20 listeners on my active document. If you put a log message
> into restartTimer (line 179), you will see, updateBlockChain will be invoked
> multiple times when working on the document, one time for each opened document.

Let me look at this shortly, this can be probably workarounded by attaching the listener only if the window is activated (or/and visible). If you close the opened document, does the issue still appear?
Comment 114 Petr Suchomel 2010-06-11 14:15:12 UTC
(In reply to comment #112)
> (In reply to comment #109)
> > (In reply to comment #107)
> > > (In reply to comment #105)
> > > > Please can you add some more information:
> > > > - how many blocks is the maximum?
> > > > - can you when was two weeks ago, when performance went down?
> > > > I am not really able to reproduce issue, with 5000+ blocks, performance is
> > > > worse, but not blocking (typing is OK, deletes are a bit slower)
> > > 
> > > Did you have tested the performance with a large number of (J2ME-) Java Files
> > > opened?
> > > As I described above, the Performance goes down, if more files are opened,
> > > because the DocumentPreprocessor class puts a listener into the active document
> > > for each opened Java file.
> > 
> > Yes, but until you start modifying the document, there are no changes (the
> > window is not activated), so far this should not cause additional slow downs.
> 
> In DocumentPreprocessor.java, Line 143 (in the mobility.editor module) the
> DocumentListener is attached to the active document. So, if I'm working with 20
> j2me files, I get 20 listeners on my active document. If you put a log message
> into restartTimer (line 179), you will see, updateBlockChain will be invoked
> multiple times when working on the document, one time for each opened document.

The problem is not in DocumentProcessor itself as long as it register/unregisters only on active document, but DocumentProcessors being  registered for each document while all instances listens on active ..
J2MEDataObject, line 183 the DocumentPreprocessor should be declared static
private static DocumentPreprocessor documentPreprocessor;
Comment 115 Petr Suchomel 2010-06-11 15:04:50 UTC
Created attachment 100024 [details]
Patched jar file (made from trunk sources)
Comment 116 Petr Suchomel 2010-06-11 15:05:40 UTC
Guys, can you look at attached patched file?
Comment 117 Petr Suchomel 2010-06-14 10:39:22 UTC
Fixed in http://hg.netbeans.org/main/rev/39634727e301
Comment 118 Quality Engineering 2010-06-15 03:25:49 UTC
Integrated into 'main-golden', will be available in build *201006150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/39634727e301
User: psuchomel@netbeans.org
Log: Fix for #166843  -  j2me preprocessor freeze
Comment 119 rbalada 2010-06-16 08:52:43 UTC
Please verify bugfix for this bug, so it can be included in release691 repository.

Thanks,
-R
Comment 120 aste 2010-06-16 09:27:26 UTC
I now work with 6.9 beta and patched jar (2010-06-11)
It look better then previous patches.. I can't catch freeze...
And on Intel I5 2.4GHz it work comfortly.. But if i set  maximum battery profile in my laptop i can look some performance degradable, but less than without this patch... But if i turn off preprocessing performance degradable healed...
Few days later i will have possibility try build *201006150001*..
Comment 121 rbalada 2010-06-21 16:01:10 UTC
Please verify bugfix for this bug, so it can be integrated into release691 repository.

Thanks,
-R
Comment 122 rbalada 2010-06-23 22:31:40 UTC
Please verify bugfix for this bug ASAP, so it can be integrated into release691
repository.

Thanks,
-R
Comment 123 marbed 2010-06-24 12:26:59 UTC
(In reply to comment #122)
> Please verify bugfix for this bug ASAP, so it can be integrated into release691
> repository.
> 
> Thanks,
> -R

Performace is quite good but i found bug in editor:

java.lang.IllegalStateException: Timer already cancelled.
	at java.util.Timer.sched(Timer.java:354)
	at java.util.Timer.schedule(Timer.java:170)
	at org.netbeans.modules.mobility.editor.DocumentPreprocessor.restartTimer(DocumentPreprocessor.java:184)
	at org.netbeans.modules.mobility.editor.DocumentPreprocessor.propertyChange(DocumentPreprocessor.java:150)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
	at org.netbeans.api.editor.EditorRegistry.fireEvents(EditorRegistry.java:507)
	at org.netbeans.api.editor.EditorRegistry.focusGained(EditorRegistry.java:318)
	at org.netbeans.api.editor.EditorRegistry$FocusL.focusGained(EditorRegistry.java:624)
	at java.awt.AWTEventMulticaster.focusGained(AWTEventMulticaster.java:203)
	at java.awt.AWTEventMulticaster.focusGained(AWTEventMulticaster.java:202)
	at java.awt.Component.processFocusEvent(Component.java:6152)
	at java.awt.Component.processEvent(Component.java:6019)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4630)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:901)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:513)
	at java.awt.Component.dispatchEventImpl(Component.java:4502)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4460)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:137)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

After that i can't do anything with text in editor.
Comment 124 aste 2010-06-24 14:08:15 UTC
Now i work (for test) with dev. build 201006220001 (i can't find *201006150001*) - it seems good..
There is little performance degradation with enabled preprocessor.. but "freeze" now do i can't detect.. 
But i have few others runtime exceptions in this version.. I don' know is it related with this fix..

java.lang.IllegalStateException: Too many org.netbeans.modules.mobility.project.queries.FileBuiltQueryImpl$StatusImpl (3) in shared RequestProcessor; create your own
	at org.openide.util.RequestProcessor.post(RequestProcessor.java:422)
	at org.netbeans.modules.mobility.project.queries.FileBuiltQueryImpl$StatusImpl.update(FileBuiltQueryImpl.java:235)
	at org.netbeans.modules.mobility.project.queries.FileBuiltQueryImpl$StatusImpl.fileDeleted(FileBuiltQueryImpl.java:256)
	at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:459)
	at $Proxy1.fileDeleted(Unknown Source)
	at org.openide.filesystems.FCLSupport$DispatchEventWrapper.dispatchEventImpl(FCLSupport.java:148)
	at org.openide.filesystems.FCLSupport$DispatchEventWrapper.dispatchEvent(FCLSupport.java:128)
	at org.openide.filesystems.FCLSupport$1.run(FCLSupport.java:176)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957)
Comment 125 marbed 2010-06-24 14:16:57 UTC
(In reply to comment #123)
> (In reply to comment #122)
> > Please verify bugfix for this bug ASAP, so it can be integrated into release691
> > repository.
> > 
> > Thanks,
> > -R
> 
> Performace is quite good but i found bug in editor:
> 
> java.lang.IllegalStateException: Timer already cancelled.
>     at java.util.Timer.sched(Timer.java:354)
>     at java.util.Timer.schedule(Timer.java:170)
>     at
> org.netbeans.modules.mobility.editor.DocumentPreprocessor.restartTimer(DocumentPreprocessor.java:184)
>     at
> org.netbeans.modules.mobility.editor.DocumentPreprocessor.propertyChange(DocumentPreprocessor.java:150)
>     at
> java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
>     at
> org.netbeans.api.editor.EditorRegistry.fireEvents(EditorRegistry.java:507)
>     at
> org.netbeans.api.editor.EditorRegistry.focusGained(EditorRegistry.java:318)
>     at
> org.netbeans.api.editor.EditorRegistry$FocusL.focusGained(EditorRegistry.java:624)
>     at java.awt.AWTEventMulticaster.focusGained(AWTEventMulticaster.java:203)
>     at java.awt.AWTEventMulticaster.focusGained(AWTEventMulticaster.java:202)
>     at java.awt.Component.processFocusEvent(Component.java:6152)
>     at java.awt.Component.processEvent(Component.java:6019)
>     at java.awt.Container.processEvent(Container.java:2041)
>     at java.awt.Component.dispatchEventImpl(Component.java:4630)
>     at java.awt.Container.dispatchEventImpl(Container.java:2099)
>     at java.awt.Component.dispatchEvent(Component.java:4460)
>     at
> java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
>     at
> java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:901)
>     at
> java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:513)
>     at java.awt.Component.dispatchEventImpl(Component.java:4502)
>     at java.awt.Container.dispatchEventImpl(Container.java:2099)
>     at java.awt.Component.dispatchEvent(Component.java:4460)
> [catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
>     at
> org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:137)
>     at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
>     at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
>     at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
>     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
>     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
>     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
> 
> After that i can't do anything with text in editor.

Problem exists after undo/redo operations.
Comment 126 rbalada 2010-06-25 06:16:25 UTC
Last chance for inclusion in release691.

Please verify within 4 hours from now, since I have got limited time to transplant remaining bugfixes into release691 repository. June 25, 1 PM Prague time is my deadline. After that time, please do also the transplant/porting work if you want to include it.

Thank you for understanding,
-R
Comment 127 Petr Suchomel 2010-06-25 06:41:57 UTC
(In reply to comment #124)
> Now i work (for test) with dev. build 201006220001 (i can't find
> *201006150001*) - it seems good..
> There is little performance degradation with enabled preprocessor.. but
> "freeze" now do i can't detect.. 
> But i have few others runtime exceptions in this version.. I don' know is it
> related with this fix..
> 
> java.lang.IllegalStateException: Too many
> org.netbeans.modules.mobility.project.queries.FileBuiltQueryImpl$StatusImpl (3)
> in shared RequestProcessor; create your own
>     at org.openide.util.RequestProcessor.post(RequestProcessor.java:422)
>     at
> org.netbeans.modules.mobility.project.queries.FileBuiltQueryImpl$StatusImpl.update(FileBuiltQueryImpl.java:235)
>     at
> org.netbeans.modules.mobility.project.queries.FileBuiltQueryImpl$StatusImpl.fileDeleted(FileBuiltQueryImpl.java:256)
>     at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at
> org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:459)
>     at $Proxy1.fileDeleted(Unknown Source)
>     at
> org.openide.filesystems.FCLSupport$DispatchEventWrapper.dispatchEventImpl(FCLSupport.java:148)
>     at
> org.openide.filesystems.FCLSupport$DispatchEventWrapper.dispatchEvent(FCLSupport.java:128)
>     at org.openide.filesystems.FCLSupport$1.run(FCLSupport.java:176)
>     at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
> [catch] at
> org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957)

This is unrelated assertion, should not be in FCS bits
Comment 128 Petr Suchomel 2010-06-25 06:44:25 UTC
Rudo,
I believe, this can be treated as verified. Te other comments are not related to this issue.
Comment 129 aste 2010-06-25 09:33:54 UTC
Problem fixed. If error messages not related for this fix (and i think that not related) this bug can be qualified as verified
Comment 130 aste 2010-06-25 09:36:18 UTC
status changed
Comment 131 rbalada 2010-06-25 21:21:40 UTC
main #39634727e301 transplanted to release691 #db1bb581e4ce
Comment 132 Martin Fousek 2010-07-08 13:29:05 UTC
I created ~90kb file for checking that fix in NetBeans IDE 6.9.1. I tried to work with it there and all work seemed to be slow and the IDE unresponsive often for few second. Then I tried to opened it in NB IDE 6.9 for comparing and the IDE frozen forever.

So it seems that it really helped. It isn't usable for files with ~2000 lines, but it's quite common situation I think, it's too big file which should be split into several classes normally.

Verified in NetBeans IDE 6.9.1 Dev (Build 201007062301).