我正在使用Apache的Jmeter测试,我只是访问我的公司网站的一个页面并调高用户数量直到达到阈值,问题是当我到达大约3000个线程时JMeter没有运行全部他们.看一下Aggregate Graph,它只运行大约2,536(这个数字不一样,但总是在这里).
部分运行在日志中带有以下异常:
01:16 ERROR - jmeter.JMeter: Uncaught exception:
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at org.apache.jmeter.threads.ThreadGroup.start(ThreadGroup.java:293)
at org.apache.jmeter.engine.StandardJMeterEngine.startThreadGroup(StandardJMeterEngine.java:476)
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:395)
at java.lang.Thread.run(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
这种行为是一致的.另外有一次JMeter在中间撞毁输出一个文件说:
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 32756 bytes for ChunkPool::allocate
# Possible reasons:
# The system is out of physical RAM or swap space
# In 32 bit mode, the process size limit was hit
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Use 64 bit Java on a 64 bit OS
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
# Out of Memory Error (allocation.cpp:211), pid=10748, tid=11652
#
# JRE version: 6.0_31-b05
# Java VM: Java HotSpot(TM) Client VM (20.6-b01 mixed mode, sharing windows-x86 )
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我尝试在jmeter.bat中更改堆大小,但这似乎没有任何帮助.
小智 5
我有一个类似的问题,并将 jmeter.bat 中的堆大小增加到 1024M,从而解决了这个问题。
set HEAP=-Xms1024m -Xmx1024m
Run Code Online (Sandbox Code Playgroud)