"Find Usage..." appears to hang (a lot)

I have a simple class within a large project with a simple String constant like


public static final String DENTAL = "DENTAL";


If I put my cursor on MyClass.DENTAL and do a "Find Usages" IDEA appears to do a "Find in Path" instead looking for occurences of "DENTAL" instead of usages of MyClass.DENTAL.

For whatever reason this is followed by a hang where IDEA is using 99% of the CPU and becomes unresponsive and requires to be restarted from Task Manager (under Windows).

Same behavior in 9.0.2.

Running under Windows XP SP3.

Is this a setting problem, function problem, or setting?

IDEA appears to rebuild the cache every time I restart also...


Hi Martin,

Just checked your use-case with IDEA 9.0.3 CE - everything works fine, i.e. IDEA finds for the field usages.

You can do the following then:

  • upgrade to the latest IDEA 9 build (9.0.3 at the moment);
  • get a thread dump and profiling snapshot when your IDEA instance hangs on 'find usages';
  • get profiling snapshot for unexpected long rebuild on startup;



You can try to invalidate caches - File->Invalidate caches.


I'm attaching the thread dump from running IDEA from the .bat file.

Also, I'm running IDEA with -Xmx512m so I would think it has a lot of memory.

Two additional observations:

1) Same project on the Mac seem to work ok so it appears to be environmental somehow. On the Mac it DOES offer more options when the Find Usages dialog pops up before we actually start the find.

That's all I get when I try to Find Usages...


2) Every time this hang occurs and I restart all my run configuration are gone/disapeared.


Thanks but according to the Docs this forces a rebuild next time IDEA restarts, the caches rebuild every time I restart anyways.


Attaching additional thread dump and IDEA log.




Bump, any news?

This is making IDEA almost unusable and I'm being pressured to switch to Eclipse.


It seems to fix caches issues. I had similar issues with a file. Every time I opened the file, IDEA hung forever. And, yes, IDEA rebuilt caches every time. I think something was broken in their cache structure and needed to clear. I decided to invalidate the cache. It showed me a popup and after I accepted to go further it restarted IDEA and then rebuilt caches one more time. Afterwards the file did not cause IDEA to hang.