8 Replies Latest reply on Oct 22, 2007 4:21 AM by calexo

    Many Java process

    calexo

      Hello !

      I have many Java process when JBoss is started, on my RedHat Linux :
      I have right now 68 lines of this type on ps :
      root 2455 0.0 34.1 1289588 349664 ? S Oct09 0:00 /home/java/jdk1.5.0_10/bin/java -server -Xms256m -Xmx768m -Dsun.rmi.d

      But my Jboss instance is only used by 2 or 3 users, so I don't need so many servers waiting.

      How can I do to reduce, and so reduce memory used ?

      Sorry for my english ;)

      Regards,
      Alexandre

        • 1. Re: Many Java process
          peterj

          I believe there is a Linux kernel setting that determines if separate threads show up as their own processes. I can't recall the setting's name, but googling "linux kernel threading", or something like that, might help.

          • 2. Re: Many Java process
            calexo

            Thanks PerterJ,

            But, my question is : do I need to have so many threads running ?

            Alexandre

            • 3. Re: Many Java process
              peterj

              They are probably http threads, which can be adjusted in server/xxx/deploy/jboss-web.deployer/service.xml. Add a minSpareThreads entry, and reduce the maxThreads entry:

              <Connector port="8080" address="${jboss.bind.address}"
               minSpareThreads=1 maxThreads="50" maxHttpHeaderSize="8192"
               emptySessionPath="true" protocol="HTTP/1.1"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />




              • 4. Re: Many Java process
                calexo

                Hi !
                I was in high hopes with your answer, but... unfortunately, it doesn't change anything...
                In the tomcat status, I have just 4 threads running, but still more than 60 threads of java...
                Any other idea ?
                Thanks a lot,

                • 5. Re: Many Java process
                  peterj

                  All of the other threads you are seeing are threads for various services. I noticed several threads related to quartz (the scheduler service), but I am not sure if you can remove the scheduler service without causing problems.

                  • 6. Re: Many Java process
                    calexo

                    Ok, so it seems there is nothing to do to reduce memory usage!

                    Anyway, thanks a lot for your help !!

                    • 7. Re: Many Java process
                      david.wade

                      Having all those threads running while over the top for the number of users you have, does not really consume much memory and is not worth reducing.

                      It does sound like on your system that each thread is being shown as a separate process (linux makes little distinction between them). The memory being used by Jboss is not a sum of the memory displayed by each of those threads as each of those threads are in the same process space.

                      If the above is true, the memory usage is shown by just one of your ps lines.

                      It would be easier to verify the above if you posted the results of

                      ps -eLf | grep java

                      Those options supplied to ps will list out all the threads. The third column is the parent process id.

                      • 8. Re: Many Java process
                        calexo

                        Unfortunately :

                        [root@ns1 root]# ps -eLf
                        ps: error: Use -m to print threads, not Sun's nonstandard -L.
                        usage: ps -[Unix98 options]
                        ps [BSD-style options]
                        ps --[GNU-style long options]
                        ps --help for a command summary
                        [root@ns1 root]# ps -emf
                        ps: error: Thread display not implemented.
                        usage: ps -[Unix98 options]
                        ps [BSD-style options]
                        ps --[GNU-style long options]
                        ps --help for a command summary

                        Thanks anyway !