[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Java 613 Threads limit: unable to create new native thread



Hello,

I am running the following code on my debian server:

public class DieLikeADog {
  private static Object s = new Object();
  private static int count = 0;
  public static void main(String[] argv){
    for(;;){
      new Thread(new Runnable(){
          public void run(){
            synchronized(s){
              count += 1;
              System.err.println("New thread #"+count);
            }
            for(;;){
              try {
                Thread.sleep(100);
              } catch (Exception e){
                System.err.println(e);
              }
            }
          }
        }).start();
    }
  }
}

I got this code here:
http://stackoverflow.com/questions/763579/how-many-threads-can-a-java-vm-support

On my server, the program crashes after 613 threads. This is not
normal, and has to be related to my server configuration. I had the OS
installed when I started to rent the server at http://www.nuxit.com/
and I never messed with the configuration.

Debian version: 5.0.8
Java version: 1.6.0_26

Can anyone help me please ? I was forced to put my website offline
because of this bug. I always have this limit of 613 threads no matter
which program I run on my debian server.

Can anyone help please ?


Reply to: