Finding a class (Ctrl+N) throws the following exception stack trace over and over ...

I have a reasonably large project open in IDEA 9.0.3, on Linux, -Xms1g, -Xmx2g.
After working on this project without problems for a 2-3 hours, when I do Ctrl+N, I suddenly start seeing:
[76505252]  ERROR - plication.impl.ApplicationImpl - null
java.lang.AssertionError
     at  com.intellij.openapi.vfs.newvfs.persistent.PersistentFS.getParent(PersistentFS.java:261)
     at  com.intellij.openapi.vfs.newvfs.persistent.PersistentFS.c(PersistentFS.java:694)
     at  com.intellij.openapi.vfs.newvfs.persistent.PersistentFS.findFileById(PersistentFS.java:678)
     at  com.intellij.openapi.vfs.newvfs.persistent.PersistentFS.c(PersistentFS.java:704)
     at  com.intellij.openapi.vfs.newvfs.persistent.PersistentFS.findFileById(PersistentFS.java:678)
     at  com.intellij.util.indexing.IndexInfrastructure.findFileById(IndexInfrastructure.java:121)
     at  com.intellij.psi.stubs.StubIndexImpl$1.perform(StubIndexImpl.java:178)
     at  com.intellij.psi.stubs.StubIndexImpl$1.perform(StubIndexImpl.java:176)
     at  com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:56)
     at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:176)
     at  com.intellij.psi.stubs.AbstractStubIndex.get(AbstractStubIndex.java:34)
     at  com.intellij.psi.impl.java.stubs.index.JavaShortClassNameIndex.get(JavaShortClassNameIndex.java:44)
     at  com.intellij.psi.impl.PsiShortNamesCacheImpl.getClassesByName(PsiShortNamesCacheImpl.java:59)
     at  com.intellij.psi.impl.CompositeShortNamesCache.getClassesByName(CompositeShortNamesCache.java:78)
     at  com.intellij.ide.util.gotoByName.DefaultClassNavigationContributor.getItemsByName(DefaultClassNavigationContributor.java:35)
     at  com.intellij.ide.util.gotoByName.ContributorsBasedGotoByModel.getElementsByName(ContributorsBasedGotoByModel.java:90)
     at  com.intellij.ide.util.gotoByName.ChooseByNameBase$CalcElementsThread.a(ChooseByNameBase.java:1163)
     at  com.intellij.ide.util.gotoByName.ChooseByNameBase$CalcElementsThread.access$3300(ChooseByNameBase.java:1062)
     at  com.intellij.ide.util.gotoByName.ChooseByNameBase$CalcElementsThread$1.run(ChooseByNameBase.java:1090)
     at  com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:697)
     at  com.intellij.ide.util.gotoByName.ChooseByNameBase$CalcElementsThread.run(ChooseByNameBase.java:1106)
     at  com.intellij.openapi.application.impl.ApplicationImpl$5.run(ApplicationImpl.java:331)
     at  java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
     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:619)
     at  com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:125)
[76505316]  ERROR - plication.impl.ApplicationImpl - IntelliJ IDEA  9.0.3  Build #IU-95.429
[76505316]  ERROR - plication.impl.ApplicationImpl - JDK: 1.6.0_20
[76505316]  ERROR - plication.impl.ApplicationImpl - VM: Java  HotSpot(TM) 64-Bit Server VM
[76505316]  ERROR - plication.impl.ApplicationImpl - Vendor: Sun  Microsystems Inc.
[76505317]  ERROR - plication.impl.ApplicationImpl - OS: Linux
[76505317]  ERROR - plication.impl.ApplicationImpl - Last Action:  GotoClass
[76508265]  ERROR - e.ContributorsBasedGotoByModel -  java.lang.IndexOutOfBoundsException
java.lang.RuntimeException: java.lang.IndexOutOfBoundsException
     at  com.intellij.util.io.PersistentEnumerator.enumerateImpl(PersistentEnumerator.java:354)
     at  com.intellij.util.io.PersistentEnumerator.tryEnumerate(PersistentEnumerator.java:175)
     at  com.intellij.util.io.PersistentHashMap.get(PersistentHashMap.java:219)
     at  com.intellij.util.indexing.MapIndexStorage$1$1.compute(MapIndexStorage.java:78)
     at  com.intellij.util.indexing.MapIndexStorage$1$1.compute(MapIndexStorage.java:70)
     at  com.intellij.util.indexing.ChangeTrackingValueContainer.a(ChangeTrackingValueContainer.java:125)
     at  com.intellij.util.indexing.ChangeTrackingValueContainer.getValueIterator(ChangeTrackingValueContainer.java:93)
     at  com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:53)
     at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:176)
     at  com.intellij.psi.stubs.AbstractStubIndex.get(AbstractStubIndex.java:34)
     at  com.intellij.psi.impl.java.stubs.index.JavaShortClassNameIndex.get(JavaShortClassNameIndex.java:44)
     at  com.intellij.psi.impl.PsiShortNamesCacheImpl.getClassesByName(PsiShortNamesCacheImpl.java:59)
     at  com.intellij.psi.impl.CompositeShortNamesCache.getClassesByName(CompositeShortNamesCache.java:78)
     at  com.intellij.ide.util.gotoByName.DefaultClassNavigationContributor.getItemsByName(DefaultClassNavigationContributor.java:35)
     at  com.intellij.ide.util.gotoByName.ContributorsBasedGotoByModel.getElementsByName(ContributorsBasedGotoByModel.java:90)
     at  com.intellij.ide.util.gotoByName.ChooseByNameBase$CalcElementsThread.a(ChooseByNameBase.java:1163)
     at  com.intellij.ide.util.gotoByName.ChooseByNameBase$CalcElementsThread.access$3300(ChooseByNameBase.java:1062)
     at  com.intellij.ide.util.gotoByName.ChooseByNameBase$CalcElementsThread$1.run(ChooseByNameBase.java:1090)
     at  com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:697)
     at  com.intellij.ide.util.gotoByName.ChooseByNameBase$CalcElementsThread.run(ChooseByNameBase.java:1106)
     at  com.intellij.openapi.application.impl.ApplicationImpl$5.run(ApplicationImpl.java:331)
     at  java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
     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:619)
     at  com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:125)

What should be done? (I usually invalidate the caches and restart, but that's hardly a solution).

3 comments

Hi Kedar,

Please try RC build for IDEA 9.0.4 (http://confluence.jetbrains.net/display/IDEADEV/Maia+EAP) a number of issues were fixed there.
Also there is no need to allocate such a huge heap. In general you'll only get the reverse effect. For example, for me IDEA (on project IDEA :-) works pretty good with -Xmx=512m. For a 64-bit OS just add 200m.

Eugene

0

Thanks Eugene.

I will try the RC build.

Regarding the memory limit however, I am confused. Whereas I have read that there could be negative effect of having huge -Xmx, I have hit problems when I try to open many projects (I work on several of them simultaneously, e.g. each of them is usually a Hudson plugin) and don't have enough memory. Are you suggesting I should not go beyond -Xmx768m?

Regards,
Kedar

0

> Are you suggesting I should not go beyond -Xmx768m?

Of course, it depends on a project and on a usage pattern, but you should definitely try. For me 512m allows opening two IDEA projects (a master and a branch)  at the same time.

Eugene.

0

Please sign in to leave a comment.