每次编译一个排列?

时间:2011-02-11 09:56:18

标签: java gwt uibinder

有没有办法设置gwt compiler以便在继续下一个排列之前编译每个排列直到完成?

目前,即使Xmx在64位系统上已经设置为2gb,我已经用尽了堆内存。只要它能够完成所有排列的编译,我不介意它很慢

1 个答案:

答案 0 :(得分:2)

localWorkers设置为1(或者甚至更好:核心数量减1)。

我们正在使用maven,在默认配置文件中,我们构建了一个FastCompiledGuvnor模块,在完整配置文件中,我们实现了真正的Guvnor模块:

  <plugin>
    <!--use -Dgwt.compiler.skip=true to skip GWT compiler-->
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <version>2.1.0-1</version>
    <configuration>
      <!-- The default profile needs to be fast, so we only build 1 permutation { -->
      <module>org.drools.guvnor.FastCompiledGuvnor</module>
      <draftCompile>true</draftCompile>
      <!-- } -->
      <runTarget>org.drools.guvnor.Guvnor/Guvnor.html</runTarget>
      <compileSourcesArtifacts>
        <compileSourcesArtifact>org.drools:drools-factconstraint</compileSourcesArtifact>
        <compileSourcesArtifact>org.drools:drools-ide-common</compileSourcesArtifact>
      </compileSourcesArtifacts>
      <gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath><!-- The GWT compiler must the correct JDT version -->
      <localWorkers>2</localWorkers><!-- Using all workers can temporarily hang the mouse and isn't much faster -->
      <extraJvmArgs>-Xmx512m</extraJvmArgs>
    </configuration>
    ...
  </plugin>

    ... profile ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <configuration>
          <!-- Build all GWT permutations and optimize them -->
          <module>org.drools.guvnor.Guvnor</module>
          <draftCompile>false</draftCompile>
        </configuration>
      </plugin>