ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <>
Subject Re: OutOfMemory errors
Date Tue, 10 Sep 2002 19:06:04 GMT
Axis has a little problem, or 'ant has a problem that Axis raises'...

----- Original Message -----
From: "Matt Seibert" <>
To: <>
Sent: Tuesday, September 10, 2002 09:37
Subject: OutOfMemory errors

> I saw in the archives that this was discussed a while back, but none of
> those solutioms resolve my issue:
> I am running the ant optional "ForEach" task, iterating through some
> "disjoint" trees, anting their build.xml files as I find them.  In each of
> these files, there are javac calls, copy calls, and other tasks.
> at this point, the top-level ant COULD be a shell script, but I'm tryig to
> keep things consistant across systems.

(Matt means ant-contrib foreach, obviously, there is a copy in xml-axis)

> As the main process runs, it chews up more and more memory over time,
> eventually running over the physical limit, generating an OutOfMemory
> exception, and stopping the build process.
> I would expect to see the memory used fluctuate as the proccesses run, but
> I would also expect to see the memory used to go back to it's original
> value between calls.
> I have tried ant 1.5, 1.5.1, and the 1.6 beta, and they all experience
> problem.  Any assistance would be GREATLY welcomed.

I should emphasise that this is stopping Gump build axis, with only a few
days before 1.0 release. Matt was trying not to panic everyone.

I think the problem may be in <foreach>, which creates a new <antcall>
instance for each element, using Project.create(), which of course calls
Project.addCreatedTask(). So the project caches all tasks, all subtasks,

...DD - does subant have the same problem?


1. we add a removeCreatedTask() method that removes a task from the list.
trouble w/ this approach is that people have to remember and the
Project.createdTasks structure isnt set up for removal of individual tasks,
just whole types.

2. we add createHelperTask() call that doesnt add it to the list.

3. we use weak references in createdTasks, so if all other references are
voided, this createdTask list doesnt keep memory around.

I've coded 2 (it was easy), but dont like it as it changes the API. Weak
references are better.


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

View raw message