ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Lefevre" <eric.lefe...@valtech.co.uk>
Subject RE: forking javac with specified memory settings
Date Wed, 22 Aug 2001 18:28:41 GMT
Sounds like a good idea to me, but I'm concerned about the value
returned by totalMemory().

I've done a quick test and here is what I get:
* parameters:  -Xmx128m -Xms1m
Runtime.getRuntime().totalMemory() returns 983040 bytes
* parameters:  -Xmx128m -Xms128m
Runtime.getRuntime().totalMemory() returns 133955584 bytes

So, we are OK if the initial minimum memory size is roughly equal to the
maximum, but otherwise we might end up with strange errors (I think).

Eric

> -----Original Message-----
> From: Brian Deitte [mailto:bdeitte@macromedia.com]
> Sent: 22 August 2001 19:01
> To: 'ant-dev@jakarta.apache.org'
> Subject: RE: forking javac with specified memory settings
>
>
> A nice addition to this would also be to default to setting the
> memoryMaximumSize to (Runtime.getRuntime().totalMemory() / 1048576)
>
> > -----Original Message-----
> > From: Eric Lefevre [mailto:eric.lefevre@valtech.co.uk]
> > Sent: Wednesday, August 22, 2001 12:59 PM
> > To: ant-dev@jakarta.apache.org
> > Subject: forking javac with specified memory settings
> >
> >
> > Hello all,
> >
> > This is a follow-up on the bug/improvement that I have
> > submitted earlier
> > today (bug 3225).
> > As the current situation is preventing us from using the
> fork/extJavac
> > option and therefore from using CruiseControl, I have
> hacked the code
> > locally to make Ant 1.4beta2 work for us.
> >
> > My proposal is to add the following attributes to the <javac> task:
> > memoryInitialSize and memoryMaximumSize.
> > A call to <javac> would look like this:
> >  <javac extdirs="resources\lib\shared"
> >         fork="yes"
> >         memoryInitialSize="128m"
> >         memoryMaximumSize="256m"
> >         classpath=" "
> >         srcdir="${basedir}/sources/java"
> >         destdir="${basedir}/classes"
> >         includes="${shared.root}/*.java" />
> >
> > The system call to javac would then include the parameters
> > "-J-Xms128m"
> > and "-J-Xmx256m". This seems to work well on my machine
> > (Win2K with JDK
> > 1.3 & JDK 1.3.1).
> >
> > ant.taskdefs.Javac and
> > ant.taskdefs.compilers.DefaultCompilerAdapter are
> > the classes where changes occur.
> >
> > Do you think my solution is proper? is there any risk this
> would break
> > on other systems/JDKs?
> >
> > Keeping in mind that fork is only supposed to work for the
> JDK's javac
> > and only on version 1.1 or higher, I do not expect problems.
> >
> > Eric
> >
>


Mime
View raw message