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 85167 - There is a memory leak in Find usages
Summary: There is a memory leak in Find usages
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords:
Depends on:
Blocks: 87136
  Show dependency tree
 
Reported: 2006-09-18 18:25 UTC by Tomas Zezula
Modified: 2007-01-17 10:09 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 Tomas Zezula 2006-09-18 18:25:49 UTC
Trying to find the usages of the LuceneIndex.getUsagesData().
Sometimes I get the correct set of usages but sometimes I get 0 occurences.
While debugging it I found that ClassIndex returns the same (correct) set of
files. When it get broken it obstinately returns the wrong value until restart.
Comment 1 Jan Becicka 2006-09-18 21:55:41 UTC
There must be some exception in the log or console I guess. Can you check it?
Code itself does not use quantum phenomena - it should be deterministic.
Comment 2 Tomas Zezula 2006-09-19 09:10:03 UTC
The thrown exception:
 java.io.IOException
     [exec]     at
org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:524)
     [exec]     at
org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin.prepare(JavaWhereUsedQueryPlugin.java:139)
     [exec]     at
org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:329)
     [exec]     at
org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:170)
     [exec]     at
org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:684)
     [exec]     at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:541)
     [exec]     at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:963)
     [exec] Caused by:
org.netbeans.api.java.source.JavaSource$UnsufficientMemoryException: Not enough
memory to process file:
home/tom/NetBeansProjects/netbeans/retouche/nb_all/retouche/jbrowse/src/org/netbeans/modules/java/source/usages/RepositoryUpdater.java
     [exec]     at
org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:519)
     [exec]     ... 6 more
     [exec] SEVERE: compiler.getCompilationUnit() is null
org.netbeans.api.java.source.WorkingCopy@af61ce
     [exec] SEVERE: compiler.getCompilationUnit() is null
org.netbeans.api.java.source.WorkingCopy@173c15c
     [exec] java.io.IOException
     [exec]     at
org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:524)
     [exec]     at
org.netbeans.modules.refactoring.java.plugins.JavaWhereUsedQueryPlugin.prepare(JavaWhereUsedQueryPlugin.java:139)
     [exec]     at
org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:329)
     [exec]     at
org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:170)
     [exec]     at
org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:684)
     [exec]     at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:541)
     [exec]     at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:963)
     [exec] Caused by:
org.netbeans.api.java.source.JavaSource$UnsufficientMemoryException: Not enough
memory to process file:
home/tom/NetBeansProjects/netbeans/retouche/nb_all/retouche/jbrowse/src/org/netbeans/api/java/source/ClassIndex.java
     [exec]     at
org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:519)

This exception signals big memory leak during find usages, it seems that
something holds reference to the invalid javac. You have to call the find usages 
at least 5 times on the LI.getUsagesData() to get it broken.
Comment 3 Jan Becicka 2006-09-29 13:02:40 UTC
Hm. It doesn't seem that javac is held after Find Usages. I have jbrowse module
and all dependent and memory usage always go back to 35 megs. I need to evaluate
it in memory profiler.
Comment 4 Jan Becicka 2006-10-11 09:53:59 UTC
Hopefully fixed. Find usages did not clean up it's caches if there was some
exception raised during building of usages tree.
Comment 5 Jan Becicka 2006-10-11 09:54:12 UTC
Checking in RefactoringPanel.java;
/cvs/refactoring/api/src/org/netbeans/modules/refactoring/spi/impl/Attic/RefactoringPanel.java,v
 <--  RefactoringPanel.java
new revision: 1.1.2.2; previous revision: 1.1.2.1
done