Bug 36156 - Linux - Build process fails OutOfMemoryError
Summary: Linux - Build process fails OutOfMemoryError
Status: RESOLVED INVALID
Alias: None
Product: Ant
Classification: Unclassified
Component: Build Process (show other bugs)
Version: unspecified
Hardware: Other other
: P1 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords: ErrorMessage
Depends on:
Blocks:
 
Reported: 2005-08-12 05:34 UTC by Raj
Modified: 2008-08-29 08:03 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raj 2005-08-12 05:34:49 UTC
Increased heap size in .bash_profile 

export ANT_OPTS="-Xms2548m -Xmx2548m"

Been a AS/400 guy, into linux/ant build stuff now. Going crazy. The build is 
huge application and has multiple XMLs.

Verbose log

      [jar] adding entry 
com/yantra/ycp/customdb/YFS_Agent_Criteria_TemplateImpl.class
      [jar] adding entry 
com/yantra/ycp/customdb/YFS_Answer_Capacity_ImpactImpl.class
      [jar] adding entry com/yantra/ycp/customdb/YFS_Answer_MasterImpl.class
      [ant] Exiting /app/yandev00/NOMSbuild/deploy/script/yantraBuild.xml.
java.lang.OutOfMemoryError: ZIP004:OutOfMemoryError, MEM_ERROR in inflateInit2
        at java.util.zip.Inflater.init(Native Method)
        at java.util.zip.Inflater.<init>(Inflater.java(Compiled Code))
        at java.util.zip.ZipFile.getInflater(ZipFile.java:284)
        at java.util.zip.ZipFile.getInputStream(ZipFile.java:228)
        at java.util.zip.ZipFile.getInputStream(ZipFile.java:207)
        at java.util.jar.JarFile.getInputStream(JarFile.java:420)
        at sun.misc.URLClassPath$5.getInputStream(URLClassPath.java:678)
        at sun.misc.Resource.getBytes(Resource.java:75)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:471)
        at java.net.URLClassLoader.access$500(URLClassLoader.java(Inlined 
Compiled Code))
        at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java
(Compiled Code))
        at java.security.AccessController.doPrivileged1(Native Method)
        at java.security.AccessController.doPrivileged(AccessController.java
(Compiled Code))
        at java.net.URLClassLoader.findClass(URLClassLoader.java(Compiled 
Code))
        at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
        at java.lang.ClassLoader.loadClass(ClassLoader.java:494)
        at org.apache.tools.ant.DefaultLogger.formatTime
(DefaultLogger.java:276)
        at org.apache.tools.ant.DefaultLogger.buildFinished
(DefaultLogger.java:156)
        at org.apache.tools.ant.Project.fireBuildFinished(Project.java:1796)
        at org.apache.tools.ant.Main.runBuild(Main.java:693)
        at org.apache.tools.ant.Main.startAnt(Main.java:188)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
ZIP004:OutOfMemoryError, MEM_ERROR in inflateInit2
Comment 1 Alexey Solofnenko 2005-08-12 06:20:55 UTC
Do you use XML logger?
Comment 2 Raj 2005-08-12 06:26:35 UTC
(In reply to comment #1)
> Do you use XML logger?

No, I am not familiar with XML logger. Is it something I can download into a 
user directory in Linux and use for debugging purpose?
Thanks for replying.
Comment 3 Alexey Solofnenko 2005-08-12 06:37:36 UTC
ANT can output its result in XML format. Can you isolate the target(s) that
require a lot of memory? The target that finally crashes is not always the
reason for the crash. Do you use scripts and/or third party tasks?

What ANT version are you using on Linux?
Comment 4 Raj 2005-08-12 06:47:00 UTC
(In reply to comment #3)
> ANT can output its result in XML format. Can you isolate the target(s) that
> require a lot of memory? The target that finally crashes is not always the
> reason for the crash. Do you use scripts and/or third party tasks?
> What ANT version are you using on Linux?

I am using apache-ant-1.6.2 Most of the Ant script was written by me using a 
different project ANT script as template. 

Here is what happend in the last few minutes:
Changed .bash_profile to export ANT_OPTS="-Xmx1536m -Xms256m" based on input 
from ASF Bugzilla Bug 28261. It helped to get over the OutOfMemoryError and 
ended in SCP error "pipe closed". I have listed the output below, ,but I am 
still worried about the OutOfMemoryError. I am suspicious that it will come 
again.

Thanks

   [untar] expanding yantraClusterDeploy.jacl 
to /app/yandev00/NOMSbuild/artifacts/temp/yantraClusterDeploy.jacl
    [untar] expand complete
      [scp] Connecting to fralnxnmsapp4:22
      [scp] Sending: yantraDeploy.jacl : 9332
      [scp] File transfer time: 0.07 Average Rate: 137,235.29 B/s
      [scp] done.
      [scp] Connecting to fralnxnmsapp4:22
      [scp] Sending: yantra.ear : 144780871
      [scp] File transfer time: 187.65 Average Rate: 771,535.07 B/s
      [scp] done.
      [scp] Connecting to fralnxnmsapp4:22
      [scp] Sending: yantraFiles.tar : 1285427200
      [scp] KEXINIT
      [scp] File transfer time: 1,182.28 Average Rate: 906,975.61 B/s
      [ant] Exiting /app/yandev00/NOMSbuild/deploy/script/yantraBuild.xml.

BUILD FAILED
/app/yandev00/NOMSbuild/build1.xml:145: The following error occurred while 
executing this line:
/app/yandev00/NOMSbuild/deploy/script/yantraBuild.xml:474: 
java.io.IOException: Pipe closed
        at org.apache.tools.ant.ProjectHelper.addLocationToBuildException
(ProjectHelper.java:539)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:388)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
        at org.apache.tools.ant.Main.runBuild(Main.java:673)
        at org.apache.tools.ant.Main.startAnt(Main.java:188)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Caused by: /app/yandev00/NOMSbuild/deploy/script/yantraBuild.xml:474: 
java.io.IOException: Pipe closed
        at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:187)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
                                                                               
                         
Comment 5 Steve Loughran 2005-08-12 12:14:13 UTC
if something is causing you to run out of that much memory, you have a serious
problem.

1. are there any <java> things you run, especially your own/custom apps that run
with fork=false. Fork them into new JVMs

2. are there any custom tasks you use? XDoclet?

3. Java 1.5 has fancy stuff for monitoring the memory consumption of a running
app; the jconsole stuff. If you are running java1.5, look at the jconsole docs
and configure Ant to run in a monitorable state...then look at where memory is
going.
Comment 6 Steve Loughran 2006-07-04 20:37:44 UTC
Raj,

Have you made any progress on finding the cause of this problem? Did you try our
suggestions?
Comment 7 Peter Reilly 2006-09-17 22:27:44 UTC
Either a configuration problem, complex script orlarge
code base. Marking as invalid - insufficient info
Comment 8 Palanivel Rajan 2008-05-07 03:46:58 UTC
Team,

I am able to reproduce this bug.

I am trying to compile a huge application(build takes 3 hours!!!!) with ANT.1.6.5 and with a XMLLogger in verbose mode. This is error occurs at the end of my build.so i my guess is that it is happening when you try to write the XMLLogger output.

I tried to do the same activity without verbose mode and its completes successfully.

Size of my xml log output(with verbose) :11.1 MB
Size of my xml log output(without verbose) :592 KB

I am running my build in window 2003 server


BUILD FAILED

java.lang.OutOfMemoryError: ZIP004:OutOfMemoryError, MEM_ERROR in inflateInit2
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
	at org.apache.tools.ant.Main.runBuild(Main.java:668)
	at org.apache.tools.ant.Main.startAnt(Main.java:187)
	at org.apache.tools.ant.Main.start(Main.java:150)
	at org.apache.tools.ant.Main.main(Main.java:240)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:615)
	at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:263)
Caused by: java.lang.OutOfMemoryError: ZIP004:OutOfMemoryError, MEM_ERROR in inflateInit2
	at java.util.zip.Inflater.init(Native Method)
	at java.util.zip.Inflater.<init>(Inflater.java:95)
	at org.apache.tools.zip.ZipFile.getInputStream(ZipFile.java:208)
	at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:121)
	at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:92)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:341)
	at org.apache.tools.ant.Target.performTasks(Target.java:369)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
	... 12 more
--- Nested Exception ---
java.lang.OutOfMemoryError: ZIP004:OutOfMemoryError, MEM_ERROR in inflateInit2
	at java.util.zip.Inflater.init(Native Method)
	at java.util.zip.Inflater.<init>(Inflater.java:95)
	at org.apache.tools.zip.ZipFile.getInputStream(ZipFile.java:208)
	at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:121)
	at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:92)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:341)
	at org.apache.tools.ant.Target.performTasks(Target.java:369)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
	at org.apache.tools.ant.Main.runBuild(Main.java:668)
	at org.apache.tools.ant.Main.startAnt(Main.java:187)
	at org.apache.tools.ant.Main.start(Main.java:150)
	at org.apache.tools.ant.Main.main(Main.java:240)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:615)
	at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:263)
Comment 9 Stefan Bodewig 2008-08-29 08:03:27 UTC
(In reply to comment #8)
> Team,
> 
> I am able to reproduce this bug.

No, you are reproducing bug 35476

The original post didn't talk about XMLLogger at all, so it must be (have been) a different issue.