1、os::commit_memory
运行jmeter,报错:
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000e0000000, 536870912, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 536870912 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /root/apache-jmeter-5.2.1/hs_err_pid12705.log
这是因为系统内存分配不够,两个方案:一个增加内存,另一个设置堆大小
方案二:设置堆大小:
编辑jmeter/bin路径下的jmeter文件:
vim /root/apache-jmeter-5.2.1/bin/jmeter
找到:"${HEAP:="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m"}
默认为1g,你可以根据自己的实际容量,设置多少,我的发现只有100多M,只能设置小一点才可以打得开jmeter了
"${HEAP:="-Xms100m -Xmx100m -XX:MaxMetaspaceSize=256m"}
2、非GUI运行驱动异常:
报错:
Error in NonGUIDriver com.thoughtworks.xstream.io.StreamException:
An error occurred: Error in NonGUIDriver
这个原因大部分为jmx文件异常,或者自己在保存时没有正常保存到,建议重新看一下,重新打开jmeter查看再拷贝进来
3、CannotResolveClassException: kg.apc.jmeter.vizualizers.CorrectedResultCollector
Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/root/jmeter_report/docker.jmx'.
Cause:
CannotResolveClassException: kg.apc.jmeter.vizualizers.CorrectedResultCollector
Detail:com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message :
first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.save.ScriptWrapper
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/kg.apc.jmeter.vizualizers.CorrectedResultCollector
line number : 135
version : 5.2.1
-------------------------------
An error occurred: Error in NonGUIDriver Problem loading XML from:'/root/jmeter_report/docker.jmx'.
Cause:
CannotResolveClassException: kg.apc.jmeter.vizualizers.CorrectedResultCollector
Detail:com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : com.thoughtworks.xstream.converters.ConversionException
cause-message :
first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
class : org.apache.jmeter.save.ScriptWrapper
required-type : org.apache.jmeter.save.ScriptWrapper
converter-type : org.apache.jmeter.save.ScriptWrapperConverter
path : /jmeterTestPlan/hashTree/hashTree/hashTree/kg.apc.jmeter.vizualizers.CorrectedResultCollector
line number : 135
version : 5.2.1
-------------------------------
这里明显的报了插件异常,要么你的插件在当前环境有问题或者当前环境没有安装到脚本里面需要的插件。
解决方案:1、在当前环境安装插件。2、打开脚本,把对应插件删除remove重新上传运行