Unable to solve “Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread” when testing with multiple threads in JMeter
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" Here is how I edited it. I changed it from 512m to 1024m: 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: 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.
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.
How to put a button texture on another texture?
In Java, can you use negative one with substring? [closed]
Resizing image with libgdx
ArrayOutOfBounds exception when trying to parse Double to String
Can methods be referred to as functions in comments [closed]
Positioning button on the TableActivity from the code
Infinispan Clustering applications on 2 servers
How to use a random array number and a timer in java?
How can I write a method to intersperse two arrays of different lengths?
Returning null values in DAO file
Using foreach loop in JSF
How to send message using SMACK API and GTALK?
LDAP search bootstrap example
Unable To Increase UrlImageView Size! (Android)