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.
061031. I was in the middle of editing a source file in a simple j2seproject and had invoked code completion (source was probably malformed at the time) when CPU usage suddenly went to 100% and the IDE become mostly unresponsive. I took a number of thread dumps. Also the IDE got an OOME and I got an automated heap dump in jhat format.
Created attachment 35710 [details] Stderr incl. thread dumps
Created attachment 35711 [details] Heap histogram
IIRC I had a project which I had recently switched to 1.4 source level and had something like this: main(...) { for (Map.Entry e : System.getProp ^^^ CC }
Of course I cannot reproduce in a new project; the editor offers CC quickly, I accept, the background compiler warns about the unsupported construct, and all is well. The actual class I had, *after* making various changes and switching source level back to 1.5: ---%<--- package uservariantproperty; import java.util.Map; public class Main { public static void main(String[] args) { System.out.println("user.variant=" + System.getProperty("user.variant")); System.out.println("----"); for (Map.Entry e : System.getProperties().entrySet()) { String k = (String) e.getKey(); if (k.startsWith("user.")) { //System.out.println("" + k + "=" + e.getValue()); System.out.println(e); } } } } ---%<---
Haven't had such a problem since.
*** Issue 88869 has been marked as a duplicate of this issue. ***
From the attached thread dumps now I see that the problem is caused by the Javadoc popup. To get a javadoc text, the souce file of the element being displayed (class, method, field, etc.) is parsed together with sources of all referred elements. Thus, if the element being displayed had many '@see" tags, several javac instances were created and run simultaneously (as can be seen form the attached heap histogram) out of the memory. Working on a patch that would allow for parsing referred classes lazily.
Fixed. RCS file: /cvs/java/source/src/org/netbeans/modules/java/source/JavadocEnv.java,v done Checking in source/src/org/netbeans/modules/java/source/JavadocEnv.java; /cvs/java/source/src/org/netbeans/modules/java/source/JavadocEnv.java,v <-- JavadocEnv.java initial revision: 1.1 done Checking in source/src/org/netbeans/api/java/source/CompilationInfo.java; /cvs/java/source/src/org/netbeans/api/java/source/CompilationInfo.java,v <-- CompilationInfo.java new revision: 1.3; previous revision: 1.2 done Checking in source/src/org/netbeans/api/java/source/ElementUtilities.java; /cvs/java/source/src/org/netbeans/api/java/source/ElementUtilities.java,v <-- ElementUtilities.java new revision: 1.3; previous revision: 1.2 done Checking in source/src/org/netbeans/api/java/source/SourceUtils.java; /cvs/java/source/src/org/netbeans/api/java/source/SourceUtils.java,v <-- SourceUtils.java new revision: 1.9; previous revision: 1.8 done Checking in source/src/org/netbeans/api/java/source/JavaSource.java; /cvs/java/source/src/org/netbeans/api/java/source/JavaSource.java,v <-- JavaSource.java new revision: 1.10; previous revision: 1.9 done Checking in editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java; /cvs/java/editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java,v <-- JavaCompletionProvider.java new revision: 1.45; previous revision: 1.44 done Checking in editor/src/org/netbeans/modules/editor/java/JavaCompletionDoc.java; /cvs/java/editor/src/org/netbeans/modules/editor/java/JavaCompletionDoc.java,v <-- JavaCompletionDoc.java new revision: 1.4; previous revision: 1.3 done