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 224335 - Out of heap memory
Summary: Out of heap memory
Status: RESOLVED DUPLICATE of bug 223339
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.2.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-31 13:37 UTC by CMOS
Modified: 2013-01-03 22:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CMOS 2012-12-31 13:37:50 UTC
Hello there!

I have a Javafx application in netbeans. My problem is that I have a .java file in a package and when I open it for editing the ide slows down and finally hangs after a while, reporting an warning at the bottom right corner.

"A java.lang.reflect.InvocationTargetException exception has occurred.
However, the system should continue working without further problems."

"java.lang.OutOfMemoryError: Java heap space
Caused: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
[catch] at org.netbeans.modules.java.hints.providers.code.CodeHintProviderImpl$WorkerImpl.createErrors(CodeHintProviderImpl.java:299)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.runHint(HintsInvoker.java:751)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.access$300(HintsInvoker.java:110)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.runAndAdd(HintsInvoker.java:618)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:637)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:575)
	at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:103)
	at com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:159)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:795)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:94)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:643)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:575)
	at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
	at com.sun.source.util.TreeScanner.visitForLoop(TreeScanner.java:178)
	at com.sun.tools.javac.tree.JCTree$JCForLoop.accept(JCTree.java:890)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:94)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:643)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:575)
	at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
	at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:103)
	at com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:159)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:795)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:94)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:643)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:575)
	at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
	at com.sun.source.util.TreeScanner.visitForLoop(TreeScanner.java:178)
	at com.sun.tools.javac.tree.JCTree$JCForLoop.accept(JCTree.java:890)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:94)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:643)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:575)
	at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
	at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:103)
	at com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:159)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:795)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:94)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:643)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:575)
	at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
	at com.sun.source.util.TreeScanner.visitForLoop(TreeScanner.java:178)
	at com.sun.tools.javac.tree.JCTree$JCForLoop.accept(JCTree.java:890)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:94)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:643)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:575)
	at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
	at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:103)
	at com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:159)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:795)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:94)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:643)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:575)
	at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
	at com.sun.source.util.TreeScanner.visitMethod(TreeScanner.java:142)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:695)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:94)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:643)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:575)
	at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
	at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:103)
	at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:98)
	at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:132)
	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:622)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:94)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:643)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:575)
	at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
	at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:103)
	at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:98)
	at com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:119)
	at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:490)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:49)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:662)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHintsImpl(HintsInvoker.java:250)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:233)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:204)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:180)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:147)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:113)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask.run(HintsTask.java:83)
	at org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper.run(JavaSourceAccessor.java:298)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:558)
	at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:734)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	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(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
"



When running the project everything works fine. Only when I open a specific .java file it happens. All other .java files I have work normally.

I have noticed that the memory indicator at the toolbar is increasing rapidly when I open that file.

I have tried jdku7, jdk7u10, jdk6u38 cause I thought maybe there was a bug over there.
I tried different computers with the same project

This .java file was a .jsp file before and has almost the same code, just some imports different and some different variables since I was taking some data from a form of a webpage. The .jsp file can be edited normally without any hang ups..

I have tried changing the heap size of the netbeans.conf file but the ide doesn't let me make it higher than 512m.

I don't understand why a file with 400 lines of code can make such a problem..
I have 10 nested for loops. I don't know if that makes any problem.

I mention again that it's slowing down and hanging while opening the .java file and trying to edit not when running the program.
Comment 1 Jan Lahoda 2013-01-03 22:29:24 UTC
Yes, before fix of bug #223339, deeply nested loops were causing problems.

*** This bug has been marked as a duplicate of bug 223339 ***