0
votes

I am load testing MQTT connection with JMeter.

The test runs in NON-GUI mode. All listeners were disabled during the test.

Everything was fine until I increased thread number from 2k to 3k. Now, this error occurs when I am running the test:

Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread. See log file for details.

I tried increasing the HEAP size by editing the executable file "jmeter"enter image description here

Here is how I edited it. I changed it from 512m to 1024m: enter image description here

But it doesn't work. Then I changed to a larger value 2048m, still doesn't work.

I searched for this problem and found out that it might have something to do with the thread stack size. Some pointed out that I may set the thread stack size in the script too. So I tried adding the thread stack size in the executable file.

This is how I did it: enter image description here

I am not sure if it is the correct way. It didn't work too.

Some also says that maybe the HEAP size or the Thread stack size of the JVM should be increased.

Then I came across this tutorial by MKYoung:https://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/ stating the ways to change the HEAP size and the thread stack size of java.

But for setting to work I have to state a java class file at the end of the command.

java -Xss256k <class name here>

But the Jmeter is unix executable and there doesn't seem to be any java class files there.

I am really running out of ways. Please help.

1
"See log file for details." What does the log say? - bradimus
@bradimus Hi, I don't see anything helpful in the log. There are no errors. But FYI I am looking at log file jmeter.log. I am not sure if that's the log file it's talking about here. - JLT
@finalstatic Can you please mention the bit (32 or 64) of the Operating System along with the installed JVM as well? And when you say making the Heap to 2048m didn't work, are you referring to the problem or the very allocation of 2048m to JMeter did not work? Also, alternatively, have you tried running your test in a distributed mode? - M Navneet Krishna

1 Answers

1
votes

Execute ulimit -u command (shows max user processes) and amend it according to number of threads you are trying to use (and a little bit more so other processes could operate), check out How to change default number of max process per user in linux thread for details.

Apart from this make sure you are following recommendations from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure guide.