ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Hill <RH...@classmates.com>
Subject Analysis: Ant 1.5 java.lang.OutOfMemoryError
Date Thu, 24 Apr 2003 00:35:35 GMT
I ran the VM profiler and found that most of the memory allocation are from
Ant processes (see results below). 

Is there anything in Ant 1.5 that can be turned off...like logging, or
minimize the impact of AntClassLoader, etc...?

thanks,
Richard

----------------------------------------------------------------------------
----------------
ANT_OPTS="-Xrunhprof:cpu=samples,heap=sites,thread=y,file=javaProfilerLog.tx
t"
----------------------------------------------------------------------------
----------------
SITES           is a sorted list of allocation sites.  This identifies
                the most heavily allocated object types, and the TRACE
                at which those allocations occurred.

SITES BEGIN (ordered by live bytes) Wed Apr 23 15:36:23 2003
          percent         live       alloc'ed  stack class
 rank   self  accum    bytes objs   bytes objs trace name
    1  4.67%  4.67%  2336040 41715 2362920 42195  3900 java.lang.Object
    2  4.25%  8.93%  2124272 13570 5909688 49248  3603 [C
    3  3.43% 12.35%  1712840 27977 3550784 74946  3565 [C
    4  3.24% 15.59%  1616976  197 82810512 10089  4371 [B
    5  2.88% 18.47%  1440328 10088 1440328 10088  4379 [B
    6  2.86% 21.33%  1429768  469 70704008 23361  4372 [B
    7  2.66% 23.99%  1330264 8821 65346144 433169  4417 [C
    8  2.25% 26.24%  1123416 7513 61629032 408878    76 [C
    9  2.06% 28.31%  1031680 1895 62200088 82250  2093 java.lang.Object
   10  1.87% 30.17%   933360 38890 27813624 1158901  4470
java.util.Hashtable$Entry

TRACE 3900: (thread=3)
	java.util.Vector.<init>(Vector.java:97)
	java.util.Vector.<init>(Vector.java:110)
	java.util.Vector.<init>(Vector.java:119)
	org.xml.sax.helpers.AttributeListImpl.<init>(<UnknownTRACE 3708:
(thread=3)
	java.lang.StringBuffer.expandCapacity(StringBuffer.java:197)
	java.lang.StringBuffer.append(StringBuffer.java:396)
	
org.apache.tools.ant.ProjectHelper.replaceProperties(ProjectHelper.java:451)
	
org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:303)>:Unknow
n line)

TRACE 3603: (thread=3)
	java.lang.StringBuffer.expandCapacity(StringBuffer.java:197)
	java.lang.StringBuffer.append(StringBuffer.java:396)
	java.lang.StringBuffer.append(StringBuffer.java:365)
	org.apache.tools.ant.util.FileUtils.normalize(FileUtils.java:645)

TRACE 3565: (thread=3)
	java.lang.String.<init>(String.java:248)
	org.apache.xerces.xni.XMLString.toString(XMLString.java:226)
	
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocum
entFragmentScannerImpl.java:814)
	
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDo
cumentFragmentScannerImpl.java:741)

TRACE 4371: (thread=3)
	
org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:9
81)
	
org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.jav
a:1062)
	
org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1034)
	
org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:923)

TRACE 4379: (thread=3)
	java.lang.ClassLoader.defineClass0(ClassLoader.java:Native method)
	java.lang.ClassLoader.defineClass(ClassLoader.java:488)
	java.lang.reflect.Method.invoke(Method.java:Native method)
	
org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1
000)

TRACE 4372: (thread=3)
	java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:104)
	
org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:9
84)
	
org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.jav
a:1062)
	
org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1034)

TRACE 4417: (thread=3)
	java.lang.StringBuffer.expandCapacity(StringBuffer.java:197)
	java.lang.StringBuffer.append(StringBuffer.java:396)
	java.util.zip.ZipFile.getEntry(ZipFile.java:141)
	
org.apache.tools.ant.AntClassLoader.getResourceStream(AntClassLoader.java:71
1)

TRACE 76: (thread=3)
	java.lang.StringBuffer.expandCapacity(StringBuffer.java:197)
	java.lang.StringBuffer.append(StringBuffer.java:396)
	java.util.zip.ZipFile.getEntry(ZipFile.java:141)
	java.util.jar.JarFile.getEntry(JarFile.java:176)

TRACE 2093: (thread=3)
	java.util.Vector.clone(Vector.java:626)
	org.apache.tools.ant.Project.getBuildListeners(Project.java:365)
	
org.apache.tools.ant.Project.fireMessageLoggedEvent(Project.java:1964)
	org.apache.tools.ant.Project.fireMessageLogged(Project.java:1983)

TRACE 4470: (thread=3)
	java.util.Hashtable.put(Hashtable.java:400)
	org.apache.tools.ant.Project.getProperties(Project.java:576)
	org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:303)
	
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.
java:233)

----------------------------------------------------------------------------
----------------
CPU SAMPLES     is a statistical profile of program execution.  The VM
                periodically samples all running threads, and assigns
                a quantum to active TRACEs in those threads.  Entries
                in this record are TRACEs ranked by the percentage of
                total quanta they consumed; top-ranked TRACEs are
                typically hot spots in the program.

CPU SAMPLES BEGIN (total = 19783) Wed Apr 23 15:36:23 2003
rank   self  accum   count trace method
   1 50.63% 50.63%   10017  4015 java.lang.UNIXProcessReaper.run
   2  6.10% 56.73%    1206  6355 java.net.SocketInputStream.socketRead
   3  2.04% 58.77%     404    29 java.lang.Class.newInstance0
   4  1.85% 60.62%     366    31 java.lang.String.getBytes
   5  1.81% 62.43%     358    33 java.lang.String.substring
   6  1.74% 64.18%     345    32 sun.io.CharToByteSingleByte.convert
   7  1.50% 65.68%     297    30 sun.io.CharToByteConverter.<init>
   8  1.34% 67.02%     265  4470 java.util.Hashtable.put
   9  1.02% 68.03%     201  6299 java.net.PlainSocketImpl.socketConnect
  10  0.88% 68.92%     175  4261 java.lang.String.substring

TRACE 4015: (thread=7)
	java.lang.UNIXProcessReaper.run(UNIXProcess.java:Native method)
	java.lang.Thread.run(Thread.java:479)

TRACE 6355: (thread=3)
	java.net.SocketInputStream.socketRead(SocketInputStream.java:Native
method)
	java.net.SocketInputStream.read(SocketInputStream.java:85)
	java.io.BufferedInputStream.fill(BufferedInputStream.java:181)
	java.io.BufferedInputStream.read1(BufferedInputStream.java:220)

TRACE 29: (thread=3)
	java.lang.Class.newInstance0(Class.java:Native method)
	java.lang.Class.newInstance(Class.java:232)
	sun.io.Converters.newConverter(Converters.java:115)
	sun.io.Converters.newDefaultConverter(Converters.java:210)

TRACE 31: (thread=3)
	java.lang.String.getBytes(String.java:630)
	java.lang.String.getBytes(String.java:680)
	
java.io.UnixFileSystem.getBooleanAttributes0(UnixFileSystem.java:Native
method)
	java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:114)

TRACE 33: (thread=3)
	java.lang.String.substring(String.java:1522)
	java.lang.String.substring(String.java:1487)
	java.io.File.getName(File.java:290)
	java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:115)

TRACE 32: (thread=3)
	sun.io.CharToByteSingleByte.convert(CharToByteSingleByte.java:91)
	sun.io.CharToByteConverter.convertAny(CharToByteConverter.java:137)
	java.lang.String.getBytes(String.java:633)
	java.lang.String.getBytes(String.java:680)

TRACE 30: (thread=3)
	sun.io.CharToByteConverter.<init>(CharToByteConverter.java:28)
	sun.io.CharToByteSingleByte.<init>(CharToByteSingleByte.java:21)
	
sun.io.CharToByteISO8859_15_FDIS.<init>(CharToByteISO8859_15_FDIS.java:26)
	java.lang.Class.newInstance0(Class.java:Native method)

3131TRACE 4470: (thread=3)
	java.util.Hashtable.put(Hashtable.java:400)
	org.apache.tools.ant.Project.getProperties(Project.java:576)
	org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:303)
	
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.
java:233)

TRACE 6299: (thread=3)
	java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:Native
method)
	java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
	java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
	java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)

TRACE 4261: (thread=3)
	java.lang.String.substring(String.java:1522)
	java.util.StringTokenizer.nextToken(StringTokenizer.java:233)
	
org.apache.tools.ant.types.selectors.SelectorUtils.tokenizePath(SelectorUtil
s.java:520)
	
org.apache.tools.ant.types.selectors.SelectorUtils.matchPath(SelectorUtils.j
ava:216)

-----Original Message-----
From: Richard Hill [mailto:RHill@classmates.com]
Sent: Tuesday, April 22, 2003 7:32 PM
To: 'user@ant.apache.org'
Subject: Ant 1.5 java.lang.OutOfMemoryError


Hi,
I'm running a build file that calls up to 40 other ant files in series.

<target name="test" depends="clean">
    <ant antfile="test1.xml"/>
    <ant antfile="test2.xml"/>
      .
      .
    <ant antfile="test40.xml"/>
</target>

The problem is that I get the following error get to the 32n'd test:

java.lang.OutOfMemoryError
        <<no stack trace available>>
Exception in thread "main" java.lang.OutOfMemoryError
        <<no stack trace available>>

I'm running Ant 1.5 and java 1.3.1_04 on both Linux RH 8, and Win2K. My
linux box has 1.9GB of swap, and 1006MB memory.

I declared ANT_OPTS="-Xms128m -Xmx512m" in my .bashrc file...and I still get
this error (Can I declare this in my parent ant file? If so, how?)

Any suggestions on how to increase the memory?

Thanks,
Richard



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

Mime
View raw message