ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: javac
Date Tue, 12 Jul 2005 09:39:12 GMT
It may be better to give more memory to the compiler.
With enough memory a hugh number of files can be
compiled. The default memory is only I think 64M.

This can be done in a number of ways -

  - use the env variable ANT_OPTS to specify the memory
    for Ant's jvm
    example: export ANT_OPTS="-Xms200m -Xmx1000m"
            in your .bashrc file
  - spawn a jvm for the compiler
          <javac srcdir="${src}"
                 fork="true" memoryInitialSize="100m"

In extreme cases you can split the code into functional units
and compile each separately. This would not be at the level of
directories, but complete package trees. We had to do this
in a project once.


Jean Lazarou wrote:

>We are trying to create an ant build for legacy code, that is build using some make tool,
as I don't want to break the already complicated buiild, I preferred simulate the same behaviour
as the make tool we're using. As that legacy code is still alive I cannot count the files
and decide how to split because it could break in several months.
>Phil Weighill Smith <> wrote:
>Why not simply put two calls to javac in your build script and split the
>source tree in two in the same way that you have in your new task,
>passing one tree to the first call and the other to the second?
>Clearly you need to ensure that the first call compiles "pre-requisite"
>code for the second call and that you should avoid cyclic references
>between the two sets of classes.
>Phil :n.
>PS: I would consider re-structuring the application into "subsystems"
>with separate source trees and separate build scripts per subsystem.
>Dependencies between subsystems only on the class files (not the source
>files). This is the approach we have taken to great effect.
>On Tue, 2005-07-12 at 00:12 -0700, Jean Lazarou wrote:
>>We had problem with a (legacy) build from scratch, seems that, because we have too
many java files to compile, nothing is compiled (both on Linux and Windows2000). 
>>After spending 4 days on that, I decided to split the compilation, I created a new
task, name "bydir-javac". The task is derived from Javac.
>>Can I publish this? Is it a better way of doing it?
>>Jean Lazarou
>>Do You Yahoo!?
>>Tired of spam? Yahoo! Mail has the best spam protection around 
>To unsubscribe, e-mail:
>For additional commands, e-mail:
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 

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

View raw message