IDEA freezes with large generated ANTLR files

Greetings,
We use ANTLR and it generates a lot of large Java files (37Mb in 67 files). IDEA often freezes for a few minutes (up to 30 min in the worst case) while processing these files. The only resort is to kill the process and clean up cache directory. If I turn on "Power Saving Mode" it mostly helps, so not always. I found in this forum document about IDEA dumping stack dumps while freezing to be analyzed later. But it seems for me that the cure is worse then the decease. I got an impression that for a few minutes all IDEA was  doing is just print the stacks every few seconds. To illustrate I attached a list of stack dumps.

Any suggestion how to resolve the problem with freezing would be appreciated. For example, It is possible
a) disable code inspections for the specified directory.  I can do it on file by file basis but only if the file is already opened in the IDEA and it may freeze IDEA at the moment the file is loaded into IDEA.

b) turn off stack dump feature or at least increase the time interval?

Sincerely,
Pavel

Version: 11.1.4
==============================idea.exe.vmoptions
-Xms128m
-Xmx1350m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-ea



Attachment(s):
threadDumps-20121130-145414-IC-117.963.zip

Please sign in to leave a comment.