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 216053 - New Line in Editor creates 100% CPU use for 40 seconds
Summary: New Line in Editor creates 100% CPU use for 40 seconds
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.2
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords: PERFORMANCE, REGRESSION
: 216494 216506 216888 217110 217615 217721 217836 218662 219179 (view as bug list)
Depends on: 216785
Blocks:
  Show dependency tree
 
Reported: 2012-07-27 10:40 UTC by bht
Modified: 2012-09-29 10:49 UTC (History)
16 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Profiler snapshot (75.70 KB, application/octet-stream)
2012-07-27 10:40 UTC, bht
Details
Snapshot after fix (71.71 KB, application/octet-stream)
2012-08-01 07:38 UTC, bht
Details
Snapshot after fix - new line only (56.42 KB, application/octet-stream)
2012-08-03 21:03 UTC, bht
Details
Snapshot 7.2 release with code completion that failed to show (57.08 KB, application/octet-stream)
2012-08-03 22:43 UTC, bht
Details
logs in zip file (57.24 KB, application/octet-stream)
2012-08-06 10:01 UTC, bht
Details
Binary patch for testing (35.82 KB, application/java-archive)
2012-08-06 16:32 UTC, Jan Lahoda
Details
logs after patch in zip file (51.68 KB, application/octet-stream)
2012-08-07 06:29 UTC, bht
Details
Snapshot while hung (8.83 KB, application/octet-stream)
2012-08-09 07:49 UTC, bht
Details
thread dump text while hung (35.92 KB, text/plain)
2012-08-09 07:51 UTC, bht
Details
Thread dump while hung with patch (32.00 KB, application/octet-stream)
2012-08-09 08:51 UTC, bht
Details
Application snapshot while hung with patch (11.79 KB, application/octet-stream)
2012-08-09 08:52 UTC, bht
Details
Thread dump while hung with patch, IDE closed (30.99 KB, application/octet-stream)
2012-08-09 09:00 UTC, bht
Details
Application snapshot while hung with patch IDE closed (8.15 KB, application/octet-stream)
2012-08-09 09:04 UTC, bht
Details
patch created from all changesets (isn't optimized) (87.60 KB, patch)
2012-08-27 15:27 UTC, Sergey Petrov
Details | Diff
Actual patch for 72 (40.74 KB, patch)
2012-08-28 11:34 UTC, Sergey Petrov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2012-07-27 10:40:18 UTC
Created attachment 122456 [details]
Profiler snapshot

With NetBeans 7.1.2, 100% CPU lasts only for 1.5 seconds in the same scenario.

Example: Code completion too slow for productive use.

It often takes over 15 seconds, sometimes over 30 seconds for the "Please wait..." to be replaced with the list of options.

I see this in the constructor of a small class with 96 members in the list (including Obect etc.).

Sometimes repeating the same action takes even longer.

It happens as follows:

The Java file is saved and the IDE is idle for a sufficiently long time to settle.

At the end of the last line in a constructor, I press [Enter] to start a new line.

On the new line, I type this.| and request code completion after the dot.

This is where the delay occurs. Repeating the [Ctrl+Space] action incurs a similar delay for a few times.

Then sometimes it is fast again (under 1 second). Then again it becomes as slow as before.

An apparent reason for this is that after creating a new line, CPU use is at 100% for 40 seconds.
So the delay has nothing to do with code completion - code completion just suffers from CPU starvation.
Comment 1 Milutin Kristofic 2012-07-31 09:12:24 UTC
Tomas, Svata it is possible that parsing is locking document and therefore Insert Break is waiting for document lock?

I saw this in csl parsing Bug #216029 , but I don't see it in java and j2ee in snapshot.
Comment 2 bht 2012-07-31 09:35:06 UTC
I will try to answer your questions if this helps - I can still reproduce this. But I have some doubt whether I can make a testcase easily because the file is under svn control, and dependencies exist between projects.

Tabbing to the Java file in he editor has the same effect. Undoing insert line has same effect.
Comment 3 Jan Lahoda 2012-07-31 12:45:41 UTC
From what I can see (so far), the problem is that JPQLValidation invokes org.eclipse.persistence.jpa.jpql.JPQLQueryHelper, which takes quite long time (1 invocation almost 40 seconds in the attache snapshot), and does not seem to be cancelable. The code completion can then be blocked until it finishes - while this is not visible in the attached dump, I don't see a way how the it could not block the CC. Its probably necessary to investigate how to make the validation cancelable.
Comment 4 Sergey Petrov 2012-07-31 12:57:17 UTC
Can you provide a hint what should be canceled and when?
Comment 5 Sergey Petrov 2012-07-31 13:46:13 UTC
 bht,
do you have named queries in your class? how many?
Comment 6 Sergey Petrov 2012-07-31 13:57:09 UTC
http://hg.netbeans.org/web-main/rev/33e28d781030 may be part fix/fix, should improve validation performance in case of multiple nq in a class
Comment 7 Jan Lahoda 2012-07-31 14:56:52 UTC
(In reply to comment #4)
> Can you provide a hint what should be canceled and when?

Its unfortunately unlikely to be easy, but: when JPAProblemFinder$ProblemFinderCompInfo's cancel method is called, it needs to stop doing what it is doing as soon as possible and return. It currently sets a flag on a context, which is fine by itself, but noone is checking for the flag inside JPQLQueryHelper, as far as I can tell. As the JPQLQueryHelper is (as I understand) a third-party code, it might be little bit tricky to cancel it. In a similar context, I run the third-party code in a separate thread, and hard-cancel it there, but it is not a nice solution in any way.
Comment 8 Sergey Petrov 2012-07-31 15:34:00 UTC
ok, thanks, will look into canceling also.


http://hg.netbeans.org/web-main/rev/04fe2f14a1bb some more optimization, number of javasource.runmodification.. calls should drop significantly with this and above changes.
Comment 9 bht 2012-07-31 18:26:48 UTC
Yes, the class has 4 named queries.
Comment 10 Sergey Petrov 2012-07-31 19:26:38 UTC
http://hg.netbeans.org/web-main/rev/f0cc35fdd043 do not check next query if task is canceled

please try dev build after a day or two as I can't reproduce the problem with some simple steps and I need feedback, in my opinion performance should be better now
Comment 11 Quality Engineering 2012-08-01 02:34:54 UTC
Integrated into 'main-golden', will be available in build *201208010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/33e28d781030
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053 may be related, cause up 20 time fater validation in case of 60 queries in simple test case
Comment 12 bht 2012-08-01 07:38:46 UTC
Created attachment 122614 [details]
Snapshot after fix

Ran the same test with netbeans-trunk-nightly-201208010001-windows.exe

I cannot notice any improvement with this build yet.
Comment 13 Sergey Petrov 2012-08-01 07:59:22 UTC
I'm not sure if all 3 commits are in 201208010001
Comment 14 Sergey Petrov 2012-08-01 08:47:05 UTC
Jan,

Is there a better way to find type element?
In attached snapshot most tyme take 
Elements.getTypeElement call,
my fixes above only tries to minimize number of calls, but I'm not sure I can minimize this time, alos is it cancelable?
Comment 15 Sergey Petrov 2012-08-01 15:50:31 UTC
if there is nothing we can do with elements.get.. I'll make separate thread/hard cancel.
but it may have sense to check if it's valid to have 30 seconds in this method.

ps. should be patch candidate also.
Comment 16 Jan Lahoda 2012-08-01 15:58:57 UTC
Is there a way for me to see how the JPQLQueryHelper gets called (and how the Elements.getTE is invoked), so that I could debug it? It is not one invocation for 30+ seconds inside one call of Elements.getTE - the snapshot claims there were 38 invocations, but that would mean ~1 second per invocation, which still seems way too much to me (but the "samples" count may not be reliable). But would be nice to cancel at least between calls to Elements.getTE. Might be also possible to automatically cancel the getTE process, if that proves to be necessary.
Comment 17 Sergey Petrov 2012-08-01 19:33:18 UTC
thanks, I miss number of calls.

j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/jpql/TypeRepository.java

is class with these calls. 
simple use case:
create j2se project
create entity from db with all defaults (may be except package) from javadb sample database (DISCOUNT_CODE table for example).
you'll get DiscountCode class with a number of named queries, each validation for this class will use query helper, new lines will trigger validation.
Comment 18 bht 2012-08-01 21:34:56 UTC
The tested entity class contains named queries whose JPQL strings are broken down for better readability as follows:

"select\n" +
   "a.field1,\n" +
   "a.field2,\n" +
"from\n" +
   " MyEntity a,\n" +
...

Perhaps this causes additional performance degradation.

I guess it is hard for an IDE to process JPQL inside a Java class. Perhaps in future such JPQL can be read from separate JPQL files, or perhaps I have overlooked such functionality.
Comment 19 Sergey Petrov 2012-08-02 05:57:04 UTC
can you share your queries code?
30 invocations of getType after all 3 commits may happens only for very complex queries or something is wrong because query is split, it may not supported well but in my opinion shouldn't cause complex validation also
Comment 20 Sergey Petrov 2012-08-02 15:08:48 UTC
http://hg.netbeans.org/web-main/rev/4d42c10d44c9 cancel should be processed no more then one call in Eements.get..
It means in worst case from attached snapshot about 1 second instead of 40. on my system it's always withing several or dozen of milliseconds with some small project even with moderate level queries.
Comment 21 Quality Engineering 2012-08-03 02:33:30 UTC
Integrated into 'main-golden', will be available in build *201208030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/4d42c10d44c9
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053 more complex cancel logic to skip long getTypeElement for imvalidated model
Comment 22 Sergey Petrov 2012-08-03 06:52:16 UTC
just a note, fix doesn't fix processor usage as it may be ok to use processor and  but it fix response of code completion invocation.
Comment 23 Sergey Petrov 2012-08-03 14:27:25 UTC
Hope may be considered as fixed, at least as P1 and on persistence side and even processor usage should be lower now I hope (shorter time at least in some cases). On other side can't say anything about "too much" in single Elements.getTE. 
Need verification for code completion and may be other affected actions.
bht are you agree, can you verify?
Comment 24 bht 2012-08-03 21:00:40 UTC
Please provide option to turn off useless CPU usage.

Unfortunately, I cannot see a difference. Installed netbeans-trunk-nightly-201208030001-windows.exe

Opened the entity class and let the system settle down, confirmed by task manager.

In constructor, created new line, typed this. - initiated code completion and waited 43 seconds for code completion. CPU was at 100% for the whole time.

The IDE created a snapshot automatically at
http://netbeans.org/bugzilla/show_bug.cgi?id=216053

I use many named queries. But I don't use the IDE support for named queries.

I don't want to get into this because of diminishing returns.

I try:

@Entity
@NamedQueries({
    @NamedQuery(name = AddressResidential.GET_BY_PERSON, query="select object(a) from AddressResidential a where a.person= :person")
})
public class AddressResidential {

Code completion does not work here as advertised at:
http://wiki.netbeans.org/NetBeans_72_NewAndNoteworthy#JPQL_and_named_queries_support

So I get this enormous penalty for something that I don't want to use, something that does not work and something I am not convinced that even making it work is worth the effort.

It is as ugly as supporting all these alien languages in JSP files.
Comment 25 bht 2012-08-03 21:03:40 UTC
Created attachment 122731 [details]
Snapshot after fix - new line only
Comment 26 bht 2012-08-03 22:29:44 UTC
I copied the relevant projects and opened them with a separate userdir with 7.2 release and 7.3 dev without importing settings.

In both cases, after deleting the userdir, CPU usage is still high but the code completion is fast.

I suspect that the reported case has a subversion complication because the copied test case does not have any subversion information. This could also be the reason why you don't see the problem.

In any case, I cannot see any difference between 7.2 release and 7.3 dev.
Comment 27 bht 2012-08-03 22:43:10 UTC
Created attachment 122735 [details]
Snapshot 7.2 release with code completion that failed to show
Comment 28 bht 2012-08-03 23:24:12 UTC
Contrary to my previous observation, I can reproduce this without svn, so svn might not be a factor.

With 7.2 and 7.3 dev, I can avoid the CPU penalty by inserting the new line and invoking code completion fast enough (very fast). Then the code completion is instant. After dismissing the code completion, CPU use rises to 100% and a repeated code completion takes 40 seconds to show.

It appears now that code completion cannot compete with the CPU use of this CPU-intensive task and it has to wait until that task finishes.
Comment 29 bht 2012-08-04 02:43:20 UTC
In my project, high CPU load is caused by a high number of entities even if these are not related to the entity being edited.

I was able to reduce the 100% CPU time from 40 secs to 6 secs by reducing the number of entities from 56 to 15. Performance improved gradually with numbers in between.

Perhaps one can make a test with a few hundred entities and get performance to an acceptable level.
Comment 30 bht 2012-08-04 06:20:40 UTC
My system generated snapshots are at http://statistics.netbeans.org/analytics/exception.do?id=604079
Comment 31 Sergey Petrov 2012-08-06 09:03:12 UTC
ok, thanks, it looks if cpu usage at 100% it just do not get cancel even as I tried to test with some thread.sleep() instead of 100% cpu, can you attach message.log also?
Comment 32 bht 2012-08-06 10:01:12 UTC
Created attachment 122778 [details]
logs in zip file

The log contains interesting entries at the end. I think there is a complication due to a dialog popping up "refreshing hints". Then the automatic error reporter started to interfere and at around the same time (don't know whehther before or after) there is a NPE in the log. I can easily create 30 second delays but sometimes it is better.
Comment 33 Sergey Petrov 2012-08-06 10:16:11 UTC
this one line "ignored cancel for 21,468 ms." is related, can't say why it's still ignored and why there are two lines one right after another yet, first cancel works good (in 0.6 seconds). it still means even cancel do not work properly.
npe seems related to a way I tried to fix the issue and will be just skipped in next builds.
regarding allow to disable cpu consumption, it may be an option too, but either feature of jpql validation need to be disabled in patch or new configuration should be added. in my opinion I need to play with canceling  first an try to make it working better.
Comment 34 Sergey Petrov 2012-08-06 10:30:50 UTC
I see quite a lot of warnings unrelated with newline but regarding time to complete something, not sure if it may be somehow related anyway. Will try to play with some dozens of entities.
Comment 35 Sergey Petrov 2012-08-06 11:37:03 UTC
just tried about 30 entities and about 30 simple named q in edited entity and still works fast enough with cancel ignored for about 100ms and only once per completion invocation, I see no second warning here. Tried also to add all libraryes I can add with "Add Library" and still have reasonable time.
the only problem I got is http://netbeans.org/bugzilla/show_bug.cgi?id=200332
after addition of a lot of dependencies to web project and cc during scanning, need to check if it's also related.
Comment 36 Sergey Petrov 2012-08-06 11:58:46 UTC
Jan, Tomas, did you get a chance to look into this issue? I have no more ideas what may cause slowness here for now.

Bernard, what do you mean by userdir remove? is it config or cache dir or both?
Comment 37 Jan Lahoda 2012-08-06 13:30:52 UTC
(In reply to comment #36)
> Jan, Tomas, did you get a chance to look into this issue? I have no more ideas
> what may cause slowness here for now.

I tried, but was not able (yet) to get to a state where there would be more than a few calls to Elements.getTE, and that these would take a significant amount of time. 

> 
> Bernard, what do you mean by userdir remove? is it config or cache dir or both?
Comment 38 Sergey Petrov 2012-08-06 14:42:32 UTC
a bit more optimization
http://hg.netbeans.org/web-main/rev/ac886697d0b8
should help to reduce number of getTypeElement calls in case of complex queries with a lot of usage of different object fields as this constructions like "{a}"."{b}" are tested as type elements by parser. please wait for integration.
Comment 39 Jan Lahoda 2012-08-06 16:32:01 UTC
Bernard, would you be willing to test a patch? The snapshots show a lot of time spent in File.listFiles, so I tried to cache the results. The patch is not good for "production" use (consumes quite a lot of memory, and there might be issues with clearing the cache), but could give us idea whether caching the listFiles result might help or not.

To apply the patch, place the jar file I am going to attach to:
${NETBEANS_INSTALL_DIR}/java/modules/patches/org-netbeans-modules-java-source
(java/modules should exist, patches/org-netbeans-modules-java-source will need to be created) and start the IDE. It should print something like this to the log on the startup:
INFO [org.netbeans.core.startup.NbEvents]: Module patch or custom extension: <path>/java-source-216053.jar

The patch should be compatible with a recent trunk builds, I can prepare similar patch for NetBeans 7.2 if desired.

To revert the effects of the patch, simply delete the jar.

Thank you.
Comment 40 Jan Lahoda 2012-08-06 16:32:26 UTC
Created attachment 122804 [details]
Binary patch for testing
Comment 41 bht 2012-08-06 17:30:21 UTC
I made large cases from a project that I opened with a freah userdir, nothing inherited with --userdir so I thought that covers config and cache, doesn't it?
Comment 42 bht 2012-08-06 17:33:51 UTC
30 entities would not be enough for a test. If you have a fast computer then perhaps 200. Performance goes down with rising numbers first a little then a lot. I have a slow computer, 2GHz, single core, 3Mb RAM
Comment 43 bht 2012-08-06 17:42:46 UTC
Where shal I copy the patch file?
Comment 44 Jan Lahoda 2012-08-06 19:02:58 UTC
(In reply to comment #43)
> Where shal I copy the patch file?

Into ${NETBEANS_INSTALL_DIR}/java/modules/patches/org-netbeans-modules-java-source
(java/modules should exist, patches/org-netbeans-modules-java-source will need
to be created) and (re-)start the IDE.

Thanks.
Comment 45 Sergey Petrov 2012-08-06 21:20:09 UTC
ok, will try to create more tomorrow, but also there should be one more commit to make things better in next build, I hope. (With assumption time is relatively equal for each Elemens.getTypeElement call), it's on persistence support side and also please tries patch above.
Comment 46 Quality Engineering 2012-08-07 02:30:35 UTC
Integrated into 'main-golden', will be available in build *201208070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ac886697d0b8
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053 optimize enum test, should drop number of getTypeElements even more
Comment 47 bht 2012-08-07 06:29:12 UTC
Created attachment 122819 [details]
logs after patch in zip file

logs with patch in
C:\Program Files\NetBeans Dev 201208030001\java\modules\patches\org-netbeans-modules-java-source\java-source-216053.jar
Comment 48 Sergey Petrov 2012-08-07 16:44:52 UTC
*** Bug 216494 has been marked as a duplicate of this bug. ***
Comment 49 Sergey Petrov 2012-08-08 11:33:49 UTC
*** Bug 216506 has been marked as a duplicate of this bug. ***
Comment 50 Sergey Petrov 2012-08-08 14:17:37 UTC
looks like number of entities doesn't matter, as I have about 1000 (but simple entities) and opening one in editor still leave memory consumption at 180mb level, near the same as opening usual java file. but it's in j2se project. and it's with very simple jpql inside.
Comment 51 autozoom 2012-08-08 15:14:46 UTC
yes I agree, we have 100s of entities and opening one with only 1 named query doesn't give problems; issues seem to arise when there are many nq o they are complex
Comment 52 Sergey Petrov 2012-08-08 16:23:36 UTC
(In reply to comment #51)
Could you provide heap dump to see memory usage?
Comment 53 bht 2012-08-09 07:49:35 UTC
Created attachment 122901 [details]
Snapshot while hung

I could open 15 entities in the editor. On each one, there was a CPU load of a few seconds. I waited for the CPU to get to 0 each time. At the 16th entity in the editor, the CPU stays at 100% indefinitely. It is very difficult to do anything with the computer after that. I took this snapsot during this period.
Comment 54 bht 2012-08-09 07:51:01 UTC
Created attachment 122902 [details]
thread dump text while hung

The last two files are without patch applied.
Comment 55 Jan Lahoda 2012-08-09 08:18:33 UTC
Bernard, could you please check memory usages (e.g. in jvisualvm, "Monitor" tab)? So that we know whether something is really slow, or whether the memory is tight (possibly due to a memory leak), slowing down the rest. Thanks.
Comment 56 bht 2012-08-09 08:32:52 UTC
In this state, visualjvm doesn't respond. I was lucky to get the thread dump, but only after killing NetBeans so I couldn'd save it. Under WinXP I tried with Windows Task Manager to lower the NetBeans.exe priority but this did not have any effect. I will try again, also I will give NetBeans more memory and will re-enable the patch.
Comment 57 bht 2012-08-09 08:51:49 UTC
Created attachment 122905 [details]
Thread dump while hung with patch
Comment 58 bht 2012-08-09 08:52:55 UTC
Created attachment 122906 [details]
Application snapshot while hung with patch
Comment 59 bht 2012-08-09 08:54:47 UTC
Now I have closed the IDE and the GUI is gone but the process still consumes 100%.
Comment 60 bht 2012-08-09 09:00:00 UTC
Created attachment 122907 [details]
Thread dump while hung with patch, IDE closed
Comment 61 bht 2012-08-09 09:04:58 UTC
Created attachment 122908 [details]
Application snapshot while hung with patch IDE closed
Comment 62 Sergey Petrov 2012-08-09 13:20:36 UTC
last hand is very strange as Name.toString() tale 15 seconds, but will replace code with a better solution as there is better method to compare name.

http://hg.netbeans.org/web-main/rev/ad57dfaae79a change compare and even more reduce in Elements.getTypeElement
Comment 63 Sergey Petrov 2012-08-09 15:34:39 UTC
I'm trying to generate 10000 entities in maven project and it takes longer in my opinion. Looks like I'll get a result tomorrow only and may be it's matter to reproduce slowness with validation.
Comment 64 Sergey Petrov 2012-08-09 15:35:07 UTC
(In reply to comment #63)
> 10000 
1000
Comment 65 bht 2012-08-09 20:28:34 UTC
Have uploaded a heap dump. Case: Patch applied, IDE closed, hung indefinitely after 15 entities opened in editor.

The files were created with the 7-zip utility, split in multiple zip files

216053_heapdump-1344503116093.zip.001
216053_heapdump-1344503116093.zip.002
216053_heapdump-1344503116093.zip.003
216053_heapdump-1344503116093.zip.004

uploaded at
http://deadlock.netbeans.org/hudson/job/upload/build
Comment 66 Quality Engineering 2012-08-10 02:24:58 UTC
Integrated into 'main-golden', will be available in build *201208100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a14d1177500e
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053 minor cleanup
Comment 67 Sergey Petrov 2012-08-10 14:42:14 UTC
http://hg.netbeans.org/web-main/rev/ba1cec2f2a36
http://hg.netbeans.org/web-main/rev/c099d7c90c4a
replace typeelements with persistentobject(wrapper with elemnthandle usage) and try to use one annotationmodelhelper for all resolve calls, may help to reduce memory usage.

autozoom,
can you try a build after above changes integration to check memory usage?
Comment 68 Quality Engineering 2012-08-11 02:37:55 UTC
Integrated into 'main-golden', will be available in build *201208110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ba1cec2f2a36
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053 replace typeelement usage with persistentobject usage in some places
Comment 69 autozoom 2012-08-12 16:21:27 UTC
I tried NetBeans Dev 201208120001 and now opening that same entity keeps memory at 600Mb.
Now it looks ok
Comment 70 bht 2012-08-13 07:26:37 UTC
netbeans-trunk-nightly-201208120001-windows.exe looks quite good. I am getting exceptions which are reported at http://statistics.netbeans.org/analytics/exception.do?id=605614 but I can keep working.
Comment 71 Sergey Petrov 2012-08-13 16:21:53 UTC
if @netbeans-trunk-nightly-201208120001-windows.exe looks quite good" 
hope can be considered as fixed now.
Comment 72 Quality Engineering 2012-08-14 02:41:27 UTC
Integrated into 'main-golden', will be available in build *201208140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/42c4a850f305
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053 avoid call to getTypeElement for invalid model as it may be out of proper thread.
Comment 73 Sergey Petrov 2012-08-14 16:02:56 UTC
bht, autozoom
thanks for your efforts on this issue, I'm trying to make fix smaller and hope a bit more efficient, can you try one more build to see if it the same or better as 201208120001.

http://hg.netbeans.org/web-main/rev/2cc39b8de892 reuse Elements from cc/validation top classes instead of new one javasource creation/check long a.b.c.d cases in enum test
Comment 74 Quality Engineering 2012-08-15 01:38:38 UTC
Integrated into 'main-golden', will be available in build *201208150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2cc39b8de892
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053 - reuse java model from top of cc/validation instead of new javasource creation, more rubust enum test for long cases like a.b.c.d
Comment 75 Quality Engineering 2012-08-17 01:27:37 UTC
Integrated into 'main-golden', will be available in build *201208170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ce30917740cf
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053, #216956 check null
Comment 76 Quality Engineering 2012-08-18 01:35:00 UTC
Integrated into 'main-golden', will be available in build *201208180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/5098ce51a4ac
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053, #216827 don't need to reparse annotation mirors as model is already created
Comment 77 autozoom 2012-08-18 11:09:54 UTC
I just tried build 20120818001, and still looks good: memory at 600Mb and editor very responsive.
But I have to point out one bad thing I didn't notice before: autocomplete for named queries only shows properties for the class, and not the properties that come from the @MappedSuperclass it inherits from.
This doesn't look good
Comment 78 Sergey Petrov 2012-08-20 09:09:56 UTC
thanks, then smaller patch may go into 7.2 patch.

regarding mapped superclass next is filed issue 217088
Comment 79 Quality Engineering 2012-08-21 15:10:24 UTC
Integrated into 'main-golden', will be available in build *201208211308* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e515274a3c8c
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053, #216827 do not support enums in default package, it shoud be exremely rare case even if some providers may support and resolve it.
Comment 80 Jiri Skrivanek 2012-08-22 11:25:39 UTC
Could you please clarify what should go to the patch release and what should be tested then?
Comment 81 Sergey Petrov 2012-08-27 13:39:27 UTC
*** Bug 216888 has been marked as a duplicate of this bug. ***
Comment 82 Sergey Petrov 2012-08-27 14:11:59 UTC
it seems fix of 217413  need to be integrated too.
unfortunately there are a lot of changes,all is covered with http://hg.netbeans.org/web-main/log?rev=%23216053 except latest one mentioned above. do you need complete diff patch attached? as some mentioned changes are replaced with later changes.

to test: it's nice to try some big JPA project, try to open entities and check if named queries are parsed and if some minor(or big) modifications to these entities cause no big delays later in response to keyboard, or other nb actions.
(it's nice to modify and try second modification right after first and some random time later 1-2.. etc seconds)
Comment 83 Sergey Petrov 2012-08-27 15:27:30 UTC
Created attachment 123622 [details]
patch created from all changesets (isn't optimized)

Patch is created from all checgesets with hg export, may be optimized to contain only real diff
Comment 84 Sergey Petrov 2012-08-28 11:34:26 UTC
Created attachment 123648 [details]
Actual patch for 72

everything related to performance/memory usage optimization in jpql validation/completion is in the patch.
it's diff as it should be integrated into 7.2
previous attached patch contain occasional elements for html, there are no actual changes in html area.

everything is integrated into latest daily in trunk.
Comment 85 Tomas Danek 2012-08-28 14:40:10 UTC
bht, can you please once again try last trunk build and let us know if you consider at as fixed? Verification in dev build is necessary in order to proceed with backporting of fix to 7.2 patch1. 
(There's a deadline for backporting - Fri 08/31)

Thanks in advance!



(In reply to comment #84)
> Created attachment 123648 [details]
> Actual patch for 72
> 
> everything related to performance/memory usage optimization in jpql
> validation/completion is in the patch.
> it's diff as it should be integrated into 7.2
> previous attached patch contain occasional elements for html, there are no
> actual changes in html area.
> 
> everything is integrated into latest daily in trunk.
Comment 86 bht 2012-08-29 12:04:34 UTC
My test with Build 201208290001 looks fine. Many thanks.
Comment 87 Tomas Danek 2012-08-29 12:19:17 UTC
Thanks for fast verification! 
Sergey, please go ahead and backport. (http://wiki.netbeans.org/NetBeansPatchesProcess)

(In reply to comment #86)
> My test with Build 201208290001 looks fine. Many thanks.
Comment 88 Sergey Petrov 2012-08-29 13:35:44 UTC
thanks, I would like to wait for 217413 verification, fix rollback one part of http://hg.netbeans.org/main-golden/rev/2cc39b8de892
will it require to reverify 216053?
Comment 89 Sergey Petrov 2012-08-31 09:41:58 UTC
http://hg.netbeans.org/releases/rev/b9ed78da1a4c migrated to release72
Comment 90 Quality Engineering 2012-09-01 11:08:44 UTC
Integrated into 'releases', will be available in build *201209010822* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/b9ed78da1a4c
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216053, #217413 improve perfomance/memory usage for jpql validation (common patch from all changesets)
Comment 91 Sergey Petrov 2012-09-03 07:47:38 UTC
*** Bug 217721 has been marked as a duplicate of this bug. ***
Comment 92 Sergey Petrov 2012-09-04 08:33:29 UTC
*** Bug 217615 has been marked as a duplicate of this bug. ***
Comment 93 Dusan Balek 2012-09-05 13:07:20 UTC
*** Bug 217110 has been marked as a duplicate of this bug. ***
Comment 94 Tomas Hurka 2012-09-06 11:14:01 UTC
*** Bug 217836 has been marked as a duplicate of this bug. ***
Comment 95 Dusan Balek 2012-09-21 08:37:51 UTC
*** Bug 218662 has been marked as a duplicate of this bug. ***
Comment 96 maks_t34 2012-09-29 10:49:01 UTC
*** Bug 219179 has been marked as a duplicate of this bug. ***