Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 26182 invoked by uid 500); 6 Jul 2001 15:59:21 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 26173 invoked from network); 6 Jul 2001 15:59:21 -0000 Message-ID: From: Mark Womack To: "'ant-user@jakarta.apache.org'" Subject: RE: java compilation out of memory problem Date: Fri, 6 Jul 2001 08:58:53 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Ming, I had the same problem as you. I found 2 solutions. 1) Increase the memory partition in the java command that launches Ant. You have already seen messages to the effect. I found that I could compile all of my files with a 75mb heap, your mileage may vary. I added these flags: "-Xms75m -Xmx75m" for the Sun 1.3 jdk that we use. 2) If requiring that much memory to compile is a concern, then use the foreach task to compile the code a directory at a time. I wrote the following tasks to do this, and it works with the default memory heap. Start by calling the target build_all_by_dir, and then if compiles all of the .java files, a directory at a time. It is very verbose with the output, and I am not sure it is a good argument for including foreach functionality in Ant, but it works. I tried to combine these three tasks into a smaller number, but didn't have much success and ran out of time. If someone out there can find a way to reduce them, I would love to hear about it. I really dislike that I have to constantly set the same params over and over. To use these tasks, you will need to include the ForeachTask class in your ant classpath. You can find the source here: http://marc.theaimsgroup.com/?l=ant-dev&m=98838238130156&w=2 Hope this helps, and if anyone has any comments or suggestions, I am all ears. -Mark -----Original Message----- From: Ming-Fang Wang [mailto:Ming-Fang.Wang@alltel.com] Sent: Friday, July 06, 2001 5:26 AM To: ant-user@jakarta.apache.org Subject: java compilation out of memory problem Hi, I run javac task on Ant to compile about 1250 java files. It starts fine, but after compiling several java programs ( about 20 of them) I got a run-out-of-memory error. The message also suggests using a switch -J-mx. I cannot find any document mentioning such a switch. Has any one encountered such a situation and got a solution to this problem? Thanks. -Ming