Whenever I am running more than 4000 threads, a testing application(jmeter) throws Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread in thread Thread[StandardJMeterEngine,5,main]. See log file for details.

There is an upper cap of 4000 on the number of maximum processes on macBook Pro M1 which I found using sudo launchctl limit maxproc.

Response of given cmd: maxproc 2666 4000

I have a RAM of 16GB. Can anyone suggest how can I increase the max processes.

  • Processes and threads are different things usually, also the exception thrown is an out of memory exception so I'm not sure increasing the possible number of processes will help you here.
    – nohillside
    Sep 27, 2022 at 14:32
  • My guess is that they are related. If you know how to increase the max process then please let me know Sep 28, 2022 at 6:15
  • Did you verify that you don't actually run out of memory? Keeping Activity Monitor running while you test your application might help here.
    – nohillside
    Sep 28, 2022 at 6:28
  • Related apple.stackexchange.com/questions/373063/…
    – nohillside
    Sep 28, 2022 at 6:30


You must log in to answer this question.

Browse other questions tagged .