We have an ANT script for generating some of our project libraries, which are based on the sources of other projects. A JAR is generated for the compiled classes with a second JAR file generated which contains the code source, both of which are assigned to a project library.
If the JAR files are re-created while IDEA is open, IDEA throws a whole load of exceptions and dies with an OOM error. Unfortunately, restarting has no affect and IDEA will go into the same state as soon as the project with the project libraries is re-opened. The only way to recover is to delete the system caches.
The stack traces thrown can be seen in the attached log file.