ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Adelöw <>
Subject RE: Not enough space
Date Fri, 16 Nov 2001 15:31:57 GMT
I have encountered this problem when stating the classpath in each task,
happened was that I not only got several instances of each class but
target  loaded a new instance of the class code on a large build it
a lot of memory. (This was with the sql task)

I removed the classpath in each task and instead added it to the ant
classpath that fixed the problem


-----Original Message-----
From: Hélène JOANIN []
Sent: den 16 november 2001 14:39
Subject: Not enough space


I'm a new user of Ant and I need advice to be able to correct my problem.
I use the Ant version 1.4.1.
I have writen an Ant build file to build my product.
The building works fine on a machine which have 512M memory.

But I have the following error: Not enough space
when I try to build my product on a machine which have 256M memory.

However, on this machine, I am able to fully build my product by calling
times ant
(without cleaning my building environment).
I haven't find any information about this kind of memory problem on the Ant
mailing list
and on the Ant FAQ.
I don't known if it's a 'normal' problem, (because Ant needs a lot of memory
resource :-( ),
or if it's due to a bug of Ant,
or if it's due to my 'non well-writed' build file ?

The building process of my product is quite complex, and I probably not write
the building file
on the "Ant Spirit".
I will try to describe the building process more in details, in order for you
give me

I can already make two remarks:
- the <antcal> task is frequently used,
- the 'fork' attribute of the <java> task is set to "yes" to be able to stop
on error.

Thanks a lot for any clue.
Kind regards.

1) The main goal of my building process.
It's simply to build a jar !
This jar file is composed of :
     - classes extracted from 'externals' jar files,
     - classes builded from java sources; note that some java sources are
     - classes builded from others classes (stub and skel)

2) How classes are extracted from 'externals' jar files ?
I got many jar files to unjar, and I want to unjar the jar file only if it is
That's why I define three various targets.

<target name="externals" depends="init">
  <antcall target="unjar_ext">
    <param name="dir" value="....." />
    <param name="name" value="....." />
  <antcall target="unjar_ext">
    <param name="dir" value="....." />
    <param name="name" value="....." />

<target name="unjar_ext">
  <uptodate property="unjar.notRequired"
    <srcfiles dir="${externals.dir}/${dir}"
  <antcall target="unjar_ext_if">
    <param name="condition" value="unjar.notRequired"/>
    <param name="dir" value="${dir}"/>
    <param name="name" value="${name}"/>

<target name="unjar_ext_if" unless="${condition}">
  <unjar src="${externals.dir}/${dir}/${name}.jar"
         dest="${build.classes.dir}" />
  <echo message="Classes of ${dir}/${name}.jar extracted"
file="${build.classes.dir}/.${name}" />

3) The "compile" process.

The compile process depends on
- the extraction of the external jar classes,
- the precompile process,
- the java sources compilation,
- the Stub/Skel generation.

The precompile process is composed of two various process.
The goal is to build java sources
- from java source 'templates', this is the jpp process;
- and from XML schema, this is the castor process.

The jpp and castor tools are java programs which are not Ant tasks.
As I want to stop the buildprocess if the command fail, I set the 'fork'
attribute of the <java>
task to "yes".

a) The JPP precompile process.

<target name="precompile_jpp_all" >
  <antcall target="precompile_jpp">
    <param name="name" value="....."/>
  <antcall target="precompile_jpp">
    <param name="name" value="....."/>

<target name="precompile_jpp">
  <uptodate property="jpp.notRequired"
    <srcfiles dir="${src.dir}"
  <antcall target="precompile_jpp_if">
     <param name="name" value="${name}"/>

<target name="precompile_jpp_if" unless="jpp.notRequired">
  <java classname="${preprocessor.jpp}" fork="true" failonerror="true">
     <arg value="-D"/>
     <arg value="${objectweb_orb}"/>
     <arg path="${src.dir}/${name}.jpp"/>
     <classpath refid="base.classpath"/>

b) The castor precompile processor

<target name="precompile_castor">
   <uptodate property="castor.notRequired"
      <srcfiles dir= "....."
   <antcall target="precompile_castor_" />

<target name="precompile_castor_" unless="castor.notRequired">
  <java classname="${preprocessor.castor}"
    <arg value="...."/>
    <arg path="...."/>
    <classpath refid="base.classpath"/>

c) The compilation  of java sources process

This is made by using the <javac> task.

d) The stub and skel building process

As the Stub/Skel compiler is not the rmic standard compiler, and as this
compiler is a java
program which is not an Ant task, the targets define to the Stub/Skel build
looks like the targets define to the JPP precompile process.

-=- Hélène JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Phone:            Fax:
  Download our EJB Server JOnAS at

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message