jmeter改进后使用中的问题与解决
by jack前一阵子针对jmeter的监控做了扩展,增加了linux监控功能。投入实际使用后,有同学反馈回来了问题。
如:
jmeter.monitor.parser.ParserImpl: Failed to parse the bytes org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.apache.jmeter.monitor.parser.ParserImpl.parseBytes(ParserImpl.java:75)
at org.apache.jmeter.monitor.model.ObjectFactory.parseBytes(ObjectFactory.java:51)
at org.apache.jmeter.visualizers.MonitorAccumModel.addSample(MonitorAccumModel.java:155)
at org.apache.jmeter.visualizers.MonitorHealthVisualizer.add(MonitorHealthVisualizer.java:84)
at org.apache.jmeter.reporters.ResultCollector.sendToVisualizer(ResultCollector.java:445)
at org.apache.jmeter.reporters.ResultCollector.sampleOccurred(ResultCollector.java:425)
at org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier.java:239)
at org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:570)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:303)
at java.lang.Thread.run(Unknown Source)
2008/09/28 20:24:12 ERROR - jmeter.threads.ListenerNotifier: Detected problem in Listener:java.lang.NullPointerException
at org.apache.jmeter.monitor.util.Stats.calculateLoad(Stats.java:191)
at org.apache.jmeter.visualizers.MonitorAccumModel.addSample(MonitorAccumModel.java:157)
at org.apache.jmeter.visualizers.MonitorHealthVisualizer.add(MonitorHealthVisualizer.java:84)
at org.apache.jmeter.reporters.ResultCollector.sendToVisualizer(ResultCollector.java:445)
at org.apache.jmeter.reporters.ResultCollector.sampleOccurred(ResultCollector.java:425)
at org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier.java:239)
at org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:570)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:303)
经过跟踪发现,由于监控器的linux端监控进程是通过生成xml提供给jmeter解析用,而当运行时间较长之后会出现xml生成变慢,刷新时恰好xml不完整,导致解析失败。
解决方法:在没有改进linux端监控进程前,最好在不用监控的时候停止linux端监控进程,需要用的时候再启动起来。
又如:开着gui执行包含较多监控器(linux监控器,其它图线等)的脚本,一段时间之后抛出错误:
jmeter.threads.JMeterThread: Test failed! java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.lang.StringCoding.safeTrim(Unknown Source)
该问题是由于绘图消耗了大量静态资源,导致堆溢出了。
解决方法:可以用non-gui方式执行,避免绘图的资源消耗。
[ 本帖最后由 qaarchitech 于 2008-11-1 13:23 编辑 ] windows上也出现这个问题了,请问哈怎么解决
页:
[1]