I'm trying to temporarily (without restarting the machine, just for test that starts a JVM) increase the number of processes to 2048 in OSX Yosemite but I'm unable to do so.
First, I tried calling ulimit -S -u 2048
but that returns:
ulimit: value exceeds hard limit
The hard limit is 1064:
$ ulimit -Hu
1064
I've used sysctl
to change the limit of kern.maxproc
and kern.maxprocperuid
and that worked fine:
$ sudo sysctl -w kern.maxprocperuid=2048
$ sudo sysctl -w kern.maxproc=2048
$ sysctl kern.maxprocperuid kern.maxproc
kern.maxprocperuid: 2048
kern.maxproc: 2048
I have also tried to change the limits of launchctl maxproc
and that seemed to work fine:
$ sudo launchctl limit maxproc 2048 2048
$ launchctl limit maxproc
maxproc 2048 2048
However, in spite of changing all this, I'm still unable to change the upper limit of ulimit -u
.
The reason I'm doing all of this is cos I'm having some OOME: Unable to create native thread
errors in a JVM that's started from a MVN test, even though I've passed to it -Xss265k -Xmx2g
.
Any ideas?