# Running out of java heap space with ant

**URL:** https://www.finalbuilder.com/forums/t/running-out-of-java-heap-space-with-ant/675
**Category:** Discussion
**Created:** [November 28, 2007, 6:45am UTC](https://www.finalbuilder.com/forums/t/running-out-of-java-heap-space-with-ant/675 "2007-11-28T06:45:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [November 28, 2007, 6:45am UTC](https://www.finalbuilder.com/forums/t/running-out-of-java-heap-space-with-ant/675/1 "2007-11-28T06:45:54Z")

</div>

Hi there, I am running out of heap space with an ant task. Is there a way to tweak the vm settings of the java process running it?

I'm running FB4.2.0.305

Cheers,

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [November 28, 2007, 11:31am UTC](https://www.finalbuilder.com/forums/t/running-out-of-java-heap-space-with-ant/675/2 "2007-11-28T11:31:17Z")

</div>

Hi Ignace,   
  
 If you go to your Java task(s) in your Ant project, you can set “fork” to True and then “maxmemory” to the amount of memory to allocate for the forked VM.   
  
 [http://ant.apache.org/manual/CoreTasks/java.html](http://ant.apache.org/manual/CoreTasks/java.html)   
  
 Regards,   
  
 Angus

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [December 7, 2007, 12:53pm UTC](https://www.finalbuilder.com/forums/t/running-out-of-java-heap-space-with-ant/675/3 "2007-12-07T12:53:59Z")

</div>

> Posted By Angus Gratton on 28 Nov 2007 4:31 PM  
> Hi Ignace,   
>   
> If you go to your Java task(s) in your Ant project, you can set "fork" to True and then "maxmemory" to the amount of memory to allocate for the forked VM.   
>   
> http://ant.apache.org/manual/CoreTasks/java.html   
>   
> Regards,   
>   
> Angus

  
  
Hi Agnus,

That works if I would be running plain java sessions from ant, but for specific ant-tasks (cvschangelog etc..) you either need to wrap them in java tasks, or you can not use this feature. Since I needed to set the memory dimensions of the java processes that is ant itself, I ended up modifying the referred ant.bat that one needs to specify in the options panel, so that it always has enough room for processing huge cvs logs. Would be a nice-to-have feature in the options panel I reckon.

Best regards,

Ignace

&nbsp;

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [December 9, 2007, 11:10am UTC](https://www.finalbuilder.com/forums/t/running-out-of-java-heap-space-with-ant/675/4 "2007-12-09T11:10:44Z")

</div>

Hi Ignace,   
  
 Thanks for the update. I’m totally surprised that CVS is using enough memory to run out of heap space, I would have thought the java sessions would use far more.   
  
 I’ll put it on the to-do list to see if we can add it.   
  
 Regards,   
  
 Angus

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [December 10, 2007, 1:04am UTC](https://www.finalbuilder.com/forums/t/running-out-of-java-heap-space-with-ant/675/5 "2007-12-10T01:04:09Z")

</div>

Great!

I should add that the default ant.bat does not really have anything that can be used to specify the -Xms -Xmx arguments, so it might involve bundling a custom ant.bat or altering the existing script.

Cheers!
