1 Reply Latest reply on Jul 26, 2003 7:57 PM by Jon Barnett


    rdb55 Newbie

      Greetings... A search for the warning on this website has not provided me with any additional information, so I'm interested in your experience here.

      Why would JBoss be running out of sockets? The only connections coming into the system are via Jetty (port 8080) and a soap service. Nothing else. We are using PostgreSQL on the backend and I wondered if their was some known problem with JBoss/Jetty/PostgreSQL..

      20:21:27,830 WARN [jbossweb] WARNING:
      java.lang.OutOfMemoryError: unable to create new native thread
      at java.lang.Thread.start(Native Method)
      at org.mortbay.util.ThreadPool$PoolThread.enterPool(ThreadPool.java:384)
      at org.mortbay.util.Pool.newPondLife(Pool.java:339)
      at org.mortbay.util.Pool.get(Pool.java:276)
      at org.mortbay.util.ThreadPool.run(ThreadPool.java:318)
      at org.mortbay.util.ThreadedServer$Acceptor.run(ThreadedServer.java:515)

      20:21:27,831 WARN [jbossweb] WARNING: Stopping Acceptor ServerSocket[addr=,port=0,localport=8080]

      I've got postgres accepting up to 5000 connections, but have limited JBoss to only using 5 3000.

      Jetty has a minimum of 10 connections and a max of 1000. I always get to about 1100 connections (it keeps growing to around this number) and then the error appears. As though Jetty is not releasing its resources.

      Is there a way to determine who owns the threads? Whether they are JBoss/Datasource connections or Jetty connections?

      None of our beans that we deploy use BMP, and there is no JDBC. Everything is straight up J2EE, JBoss.

      Any hints?


        • 1. Re: Possibilities
          Jon Barnett Master

          This is either a straight memory issue or you have reached a thread limit on your OS. BTW, what is your OS?

          Jetty is attempting to create a new thread to service a request - I'm not quite sure what at this stage as I'd need to check the Jetty source. However, your JVM is complaining it doesn't have enough memory to create a new thread (process).

          What is your memory allocation for the JVM - you can set it through JAVA_OPTS in the JBoss run script. The default Java configuration has a maximum heap size of around 16M I think. SOAP tends to chew up a lot of memory as the usual parsers tend to do their work in memory so they could work against you as well. Try to give the JVM as much memory as possible if you haven't already done so. -Xmx256m (java -X to look at what the -X arguments are) if you can afford it.

          I'll assume that your JBoss server is not so loaded that it can't physically create any more processes/threads.

          Otherwise, let us know your configuration and we can see if there is any other possible cause.