将JVM args传递给ant脚本中的clover

时间:2014-09-19 17:32:39

标签: java ant cloveretl

我在像这样的ANT脚本中从CloverETL调用runGraph类

      <java classname="org.jetel.main.runGraph" fork="true" failonerror="true">

           <arg value="${canadapostdir}/metadata/CanadaPostADDTypes34.grf"/>
                    <classpath>
                            <pathelement path="${ear.lib}/clover.jar" />
                            <pathelement path="${ear.libext}/oracle.jdbc/ojdbc6.jar" />
                            <pathelement path="${ear.libext}/mysql.jdbc/mysql-connector-java-3.0.15-ga-bin.jar" />
                            <fileset dir="${ear.lib}">
                                    <include name="*.jar"/>
                            </fileset>
                    </classpath>
            </java>

当三叶草开始时,我可以在日志中看到:

    [java] [Clover] starting WatchDog thread ...
    [java] [WatchDog] Thread started.
    [java] [WatchDog] Running on 16 CPU(s) max available memory for JVM 3005703 kB
    [java] [Clover] Initializing phase: 0
    [java]  all edges initialized successfully...
    [java]  initializing nodes:
    [java]     INPUT ...OK
    [java]     TYPEFILTER ...OK
    [java]     REF ...OK
    [java]     OUTPUT ...OK
    [java] [Clover] phase: 0 initialized successfully.
    [java] [WatchDog] Starting up all nodes in phase [0]
    [java] [WatchDog]   INPUT ... started
    [java] [WatchDog]   TYPEFILTER ... started
    [java] [WatchDog]   REF ... started
    [java] [WatchDog]   OUTPUT ... started
    [java] [WatchDog] Sucessfully started all nodes in phase!

我的问题是:如何使用比3005703 kB更多的内存来运行三叶草?服务器上实际上有100gig的免费ram正在运行此脚本。

编辑:我知道我看到三叶草没有在一个单独的jvm上运行,并且它使用了当前JVM实例上可用的所有可用内存。我需要找到一种方法来在一个单独的jvm上启动三叶草,我可以通过-Xms10240m -Xmx10240m。

1 个答案:

答案 0 :(得分:3)

<jvmarg>嵌套元素用于传递JVM参数:

<java classname="org.jetel.main.runGraph" fork="true" failonerror="true">

       <arg value="${canadapostdir}/metadata/CanadaPostADDTypes34.grf"/>
       <jvmarg value="-Xms1024M"/>
       <jvmarg value="-Xmx10240M"/>
       <classpath>
               <pathelement path="${ear.lib}/clover.jar" />
               <pathelement path="${ear.libext}/oracle.jdbc/ojdbc6.jar" />
               <pathelement path="${ear.libext}/mysql.jdbc/mysql-connector-java-3.0.15-ga-bin.jar" />
                   <fileset dir="${ear.lib}">
                         <include name="*.jar"/>
                   </fileset>
       </classpath>
</java>

正在在另一个VM中执行该类。这就是fork=true的含义。