3 Replies Latest reply on Apr 18, 2007 10:27 AM by Shai Bentin

    stack size limit

    Shai Bentin Newbie

      I've been reading through the posts here. I saw that it was recommended in many places to do the following setting on solaris:

      -XX:ThreadStackSize=128k
      


      So I did it! But when I ran it I got an error stating that this new setting of 131072 Kb exceeds the exiting limit of 8192 kB. When I changed the limit to 131072 I got a different error stating:

      Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
       at java.lang.Thread.start(Native Method)
       at org.jboss.Main.main(Main.java:450)
      


      can someone please shed some light. If my original limit is smaller and my application works (although I do have performance problems) Do I still have to change this?

        • 1. Re: stack size limit
          Peter Johnson Master

          Is there an operating system limit on the number of threads per process? (I know someone else asked this in the past week or two, but I could not find that post. He solved the problem by increasing the allowed threads.)

          • 2. Re: stack size limit
            Shai Bentin Newbie

            according to man pages changing the stack limit (which is what I did using
            ulimit -s)
            is what controlls the number of threads per process. so, I guess my problem lies elswhere.

            • 3. Re: stack size limit
              Shai Bentin Newbie

              I was able to run with the following configuration:

              # Setup JBoss sepecific properties
              JAVA_OPTS="$JAVA_OPTS -XX:ThreadStackSize=128 -Xmx3072m -Xms1024m -XX:MaxPermSize=256m"
              
              # setup java temporary disk space
              JAVA_OPTS="$JAVA_OPTS -Djava.io.tmpdir=/appdata/jboss/tmp"
              
              # the running program
              JAVA_OPTS="$JAVA_OPTS -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
              JAVA_OPTS="$JAVA_OPTS -XX:+UseParallelGC -Dprogram.name=$PROGNAME"
              


              It seems that I needed to omit tje 'k' after 128. However when I copied these same setting to my production server Jboss failed to load the application at all:

              Here is what I get:
              Could not create deployment: file:/appdata/jboss/jboss-4.0.3
              SP1/server/amit/deploy/jboss-bean.deployer/
              org.jboss.deployment.DeploymentException: Unexpected error during load of: org.jboss.kernel.deployment.jboss.JBossBeanDeployer
              , msg=org/jboss/kernel/deployment/jboss/JBossBeanDeployerMBean; - nested throwable: (java.lang.ClassNotFoundException: Unexpec
              ted error during load of: org.jboss.kernel.deployment.jboss.JBossBeanDeployer, msg=org/jboss/kernel/deployment/jboss/JBossBean
              DeployerMBean)
              


              and it goes on.... Jboss is reporting on problems with claa loading, however when I take the new settings off it works fine.

              Both the production and Test are the same Solaris OS, same JDK, running the same application server settings and version.

              What could be causing this, where do you think I should look for differences?