We have a small text box with 512Mb of ram. We wanted to see how many threads we can create in Java in this box. To our surprise, we can\'t create many. Essentially the minimum
Try setting the maximum memory allowed -Xmx to a lower value and see whether the thread count can be increased. In a project at work I could allocate around 2,5k threads with -Xmx512m and about 4k threads with -Xmx96m.
The bigger your heap the smaller your thread stack space (at least to my experience).