通过Ant运行Jmeter,报Java heap space错误
环境:
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.4binuser.properties
2010/10/29 15:31:41 INFO - jmeter.JMeter: Loading system properties from: C:jakarta-jmeter-2.4binsystem.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.4bin
2010/10/29 15:31:41 INFO - jmeter.JMeter: PWD =C:jakarta-jmeter-2.4bin
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.4bin
2010/10/29 15:31:41 INFO - jmeter.services.FileServer: Set new base=E:EbisuAnt_Jmeter_test
2010/10/29 15:31:41 INFO - jmeter.JMeter: Loading file: E:EbisuAnt_Jmeter_testFriends.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)
在网上找了很多信息,找不到解决的方法,请各位不吝赐教。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
谢谢。
你是说Jmeter的HEAP设置么,我已经设置得挺大的了,在jmeter.bat里,设HEAP=-Xms768m -Xmx1024m,
但还是不行,通过Ant运行还是会报错。
java.lang.OutOfMemoryError: Java heap space
虚拟机内存不足啊,配大点