java


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.

Related Links

Should you save an argument to an instance variable when it's going to be passed through multiple methods?
run a jarfile in a different machine from an sqlserver/issue a terminal command from an sqlserver to another windows machine
How to ensure that `methodB` is “blocked” if some threads are in `methodA` in Java?
JUnit :java.lang.IllegalStateException while executin event.queue() where event is ValueChangeEvent instance
java restful api call sql server stored procedure and get back json object
JAVA - Storing data from result set to hashmap and aggregating them
Why does the Injection of autowired dependencies failed in Spring web-service?
Is it possible to use an extended formal type parameter in java
website communicate with app
Mocking an Injected Object's Dependency
Is it possible to invoke enum subclass public method? [duplicate]
HTTP method POST is not supported by this URL in WildFly
Unable to access file from network drive
Improving my greedy Algorithm
How to set java DB property for database location dynamically?
Fixing output of The Huffman Tree

Categories

HOME
java
jdo
listview
hook
isabelle
mediawiki
deezer
pycharm
hp-exstream
vmware
bpmn
google-docs
programming-languages
graphql
youtube-api-v3
disassembler
angular-ui-bootstrap
ojdbc
flyway4
indesign
nstableview
remote-access
size
crystal-reports-2008
alpine
ml
tokenize
csrf-protection
core-text
kudan
internet-explorer-9
http-status-code-503
noraui
winrt-xaml-toolkit
adobe-premiere
bitbucket-pipelines
scaffold
hilbert-curve
preconditions
reportingservices-2005
android-mediaprojection
eigenvalue
fakeiteasy
checkboxlist
dandelion
blogengine.net
typescript1.8
git-diff
tropo
forever
r-forge
qtwebview
capacity
titanium-android
sonarlint-vs
mediaelement
nxt
azure-sdk
django-debug-toolbar
lttng
superstack
rvest
hexdump
ipconfig
tableau-online
ng-animate
coldbox
gulp-less
rdl
xojo
openexr
mesa
has-many-through
dealloc
multiprocessor
runtime.exec
qt-faststart
browser-detection
coderush
nsobject
infobox
locationlistener
yslow
ti-dsp
virtual-functions
simpletest
yagni
mdac
data-acquisition
signal-handling

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App