wiki:Doc/compiler/problems

Version 11 (modified by /C=FR/O=CNRS/OU=UMR8607/CN=Michel Jouvin/emailAddress=jouvin@…, 17 years ago) (diff)

--

Common Problems

Memory Problems

Java Heap Space

If you see messages that refer to "Java Heap Space" while running the compiler, then the java virtual machine does not have enough memory to compile the given templates. You must increase the amount of memory allocated to the java virtual machine when you start the compiler. See the section Running the Compiler for how to specify the VM memory.

Slow Compilation

If the compilation appears to be slow, check that the compiler is not thrashing because of a limited amount of memory. With the verbose option set, successful compilations will produce a summary like:

48 templates
517/0/517 compiled, 48/48 built
0/0 obj, 48/48 xml, 48/48 dep
0 errors, 31289 ms, 86 MB/506 MB heap, 11 MB/112 MB nonheap

The last line with gives the maximum amount of heap memory used and the maximum available (the value marked "heap"). If the maximum used is more than about 80% of the maximum available, then you should consider increasing the memory allocated to the java virtual machine. See the section Running the Compiler for how to specify the VM memory.

Thread Management

WARNING: missing modifyThread permission

The java-implementation of the pan language compiler is completely multi-threaded. Internally, it controls several thread pools to handle compilation, execution, and serialization in parallel. At the end of a compilation, the compiler will normally destroy the thread pools that were created. The java security model requires that a program have the "modifyThread" permission to destroy threads. In some environments (notably Eclipse), this permission may not be given to the compiler. If this is the case, then the message "WARNING: missing modifyThread permission" is printed on the standard error. Lacking this permission causes a "thread leak", but the effects are minor unless an extremely large number of templates are being compiled. If this is the case, then you should either change the configuration to grant this permission to the compiler, or work in an environment that grants it by default (e.g. using ant from the command line).

This problem is fixed if using Java6. If you have several JREs installed, be sure to configure Eclipse to use Java 6 : go to Window->Preferences->Java->Installed JREs. If you don't see the JRE you want (and you have it installed), use the "Search" button to have eclipse configure the new JRE for you. Make sure you select it after it is found.

Miscellaneous

Unnecessary rebuild of clusters

It can happen that a cluster is always rebuilt when you run ant, even if there was no change in the dependencies. In this case, you may suspect a Java issue with optimizations enabled by default (JIT). The only workaround is to disable these optimizations by adding the option -Xint to Java VM when running ant. It is achieved differently depending how you started ant :

  • From command line : define environment variable ANT_OPTS.
  • From Eclipse : right click on build.xml in ant pane, choose Run As...-> External Tools... and then click on JRE tab. Be sure to use a separate JRE (if possible Java 6 or later) and add option in the options area.

This problem has been seen on Windows only, with Java 5 and Java 6.