2
回答
通过Ant运行Jmeter,报Java heap space错误
极速云服务器,低至1.04元/天>>>   

环境:

OS: Windows XP SP3,Application:Java 1.6.0_16,Apache Ant 1.8.0,Jakarta Jmeter 2.4

写好build.xml后,通过Ant运行Jmeter并生成测试报告,之前一直是可以用的(持续有一个月时间都是好的),某天上午用这个功能也是好的,但下午就不可以了,但如果单独打开Jmeter的功能是好的。

运行Ant后报Java heap space错误,如下图:

 

jmeter.log中记录的信息是:

2010/10/29 15:31:41 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US
2010/10/29 15:31:41 INFO  - jmeter.JMeter: Loading user properties from: C:\jakarta-jmeter-2.4\bin\user.properties
2010/10/29 15:31:41 INFO  - jmeter.JMeter: Loading system properties from: C:\jakarta-jmeter-2.4\bin\system.properties
2010/10/29 15:31:41 INFO  - jmeter.JMeter: Setting JMeter property: jmeter.save.saveservice.assertion_results=all
2010/10/29 15:31:41 INFO  - jmeter.JMeter: Setting JMeter property: jmeter.save.saveservice.bytes=true
2010/10/29 15:31:41 INFO  - jmeter.JMeter: Setting JMeter property: file_format.testlog=2.1
2010/10/29 15:31:41 INFO  - jmeter.JMeter: Setting JMeter property: jmeter.save.saveservice.response_data.on_error=false
2010/10/29 15:31:41 INFO  - jmeter.JMeter: Copyright (c) 1998-2010 The Apache Software Foundation
2010/10/29 15:31:41 INFO  - jmeter.JMeter: Version 2.4 r961953
2010/10/29 15:31:41 INFO  - jmeter.JMeter: java.version=1.6.0_16
2010/10/29 15:31:41 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Client VM
2010/10/29 15:31:41 INFO  - jmeter.JMeter: os.name=Windows XP
2010/10/29 15:31:41 INFO  - jmeter.JMeter: os.arch=x86
2010/10/29 15:31:41 INFO  - jmeter.JMeter: os.version=5.1
2010/10/29 15:31:41 INFO  - jmeter.JMeter: file.encoding=Cp1252
2010/10/29 15:31:41 INFO  - jmeter.JMeter: Default Locale=English (United States)
2010/10/29 15:31:41 INFO  - jmeter.JMeter: JMeter  Locale=English (United States)
2010/10/29 15:31:41 INFO  - jmeter.JMeter: JMeterHome=C:\jakarta-jmeter-2.4
2010/10/29 15:31:41 INFO  - jmeter.JMeter: user.dir  =C:\jakarta-jmeter-2.4\bin
2010/10/29 15:31:41 INFO  - jmeter.JMeter: PWD       =C:\jakarta-jmeter-2.4\bin
2010/10/29 15:31:41 INFO  - jmeter.JMeter: IP: 10.0.40.179 Name: zhangxiaowei FullName: zhangxiaowei.suzsoft.com
2010/10/29 15:31:41 INFO  - jmeter.services.FileServer: Default base=C:\jakarta-jmeter-2.4\bin
2010/10/29 15:31:41 INFO  - jmeter.services.FileServer: Set new base=E:\Ebisu\Ant_Jmeter_test
2010/10/29 15:31:41 INFO  - jmeter.JMeter: Loading file: E:\Ebisu\Ant_Jmeter_test\Friends.jmx
2010/10/29 15:31:41 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.1
2010/10/29 15:31:41 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8
2010/10/29 15:31:41 INFO  - jmeter.save.SaveService: Using SaveService properties file version 959116
2010/10/29 15:31:41 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.1
2010/10/29 15:31:41 INFO  - jmeter.save.SaveService: All converter versions present and correct
2010/10/29 15:31:41 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Cannot find .className property for htmlParser, using default
2010/10/29 15:31:41 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is 
2010/10/29 15:31:41 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is 
2010/10/29 15:31:41 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is 
2010/10/29 15:31:41 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is 
2010/10/29 15:31:41 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
2010/10/29 15:31:41 INFO  - jmeter.protocol.http.sampler.HTTPSampler2: Local host = zhangxiaowei
2010/10/29 15:31:41 INFO  - jmeter.protocol.http.sampler.HTTPSampler: Maximum connection retries = 10
2010/10/29 15:31:48 FATAL - jmeter.JMeter: An error occurred:  java.lang.OutOfMemoryError: Java heap space
 at java.util.Arrays.copyOfRange(Arrays.java:3209)
 at java.lang.String.(String.java:215)
 at org.xmlpull.mxp1.MXParser.getText(MXParser.java:746)
 at com.thoughtworks.xstream.io.xml.XppReader.pullText(XppReader.java:89)
 at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:139)
 at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:124)
 at com.thoughtworks.xstream.io.xml.AbstractPullReader.hasMoreChildren(AbstractPullReader.java:78)
 at com.thoughtworks.xstream.io.ReaderWrapper.hasMoreChildren(ReaderWrapper.java:32)
 at org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:93)
 at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBaseConverter.unmarshal(HTTPSamplerBaseConverter.java:63)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
 at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
 at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
 at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:69)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
 at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
 at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
 at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:69)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
 at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
 at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
 at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:69)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
 at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
 at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)

 

在网上找了很多信息,找不到解决的方法,请各位不吝赐教。

举报
张子谦
发帖于7年前 2回/2K+阅
顶部