Reputation: 1
Can someone please help me with the Out of Memory (OOM) error that I encountered while running JMeter
I am a newbie in Java and in JMeter, and also in performance testing. I used the command prompt but I am still encountering Out of Memory issue. I tried to adjust the heap size but running did not continue every time I change it.
My current heap size is below
set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
I added another memory: from 8GB, my memory is now 16GB.
But when I run it again with 1000 threads, the error below is shown:
Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread in thread Thread[Thread Group 1-130,5,main]. See the log file for details.
Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread in thread Thread[Thread Group 1-63,5,main]. See log file for details.
Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread in thread Thread[Thread Group 1-135,5,main]. See log file for details.
Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread in thread Thread[Thread Group 1-19,5,main]. See log file for details.
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 32756 bytes for ChunkPool::allocate
Sometimes I am also encountering just this error:
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 32756 bytes for ChunkPool::allocate
Can someone please help me. I am just a beginner so I would appreciate if you will reply with terms that are not too technical.
Thank you in advance.
Upvotes: 0
Views: 2086
Reputation: 21
I have faced the out of memory issue on trying to run 10k vusers in 8GB RAM. Later on increased the instance memory as 16GB and 10k vusers load ran successfully.
Increase JVM memory as 12 GB in /etc/profile/
Increase JMeter Heap as 10GB in "jmeter" file(Linux OS). ('set HEAP' option is available in "jmeter.bat" file for Windows server)
3.Open files limit - 65535
Open the command window as root user Execute following commands and update values to change the default limit
root soft nproc 65535 root hard nproc 65535 root soft nofile 65535 root hard nofile 65535
fs.file-max = 65535
sysctl -p
After rebooting, the changes will be affected in the machine and kindly cross verify that.
Should run the JMeter script in Non-GUI as a root user only.
Note: Delete dump heap file in "bin" if any.
Upvotes: 0
Reputation: 168002
The error you're getting indicates that underlying operating system is not able to create a new native thread / process.
ulimit -n
command-Xss JVM argument
Unfortunately in its current shape your question doesn't provide enough information in order to come up with a comprehensive answer, if above hints don't help consider adding more details like:
Also make sure to follow recommendations from the 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article
Upvotes: 1
Reputation: 550
change Heap size in jmeter.sh file if you are using Linux/ubuntu, Jmeter.bat in windows. Increase the -Xmx1g =
to half of the memory of the system i.e., 4gb(-Xmx4g). also try to increase the user load from 500 and check the CPU and RAM utilization in Task Manager of Windows.
Upvotes: 0
Reputation: 61
the flag Xmx indicates the maximum memory for the JVM. You should increase your xmx value to something more appropriate for your usage.
try:
set HEAP=-Xms1g -Xmx4g -XX:MaxMetaspaceSize=256m
Upvotes: 0