Re: [CentOS] can't get Tomcat5 to work on centos 5.1, how do I get it to work?

2008-05-09 Thread Rudi Ahlers

Filipe Brandenburger wrote:

Hi,

On Thu, May 8, 2008 at 6:00 PM, Rudi Ahlers [EMAIL PROTECTED] wrote:
  

Exception in thread main java.lang.OutOfMemoryError: Cannot create



It looks like it's running out of memory when starting more threads.
Did you check if you have enough memory in this server to run Tomcat?
I think you need at least 512MB for it, but I would recommend more.

I know there are some tunings made to the JVM for it to request more
memory. If you do ps -ef | grep java when Tomcat is started you will
see some parameters starting with -X that will specify memory sizes,
check how much it requests. I don't really know how to tweak those,
check the script that starts Tomcat to see if it allows changing them.

HTH,
Filipe
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

  



What you're saying could be true, but I don't think it's the case.

I have confirmed with the client, and he says that 128MB RAM would be 
enough for his app.



[EMAIL PROTECTED] /]# /etc/init.d/tomcat5 restart
Starting tomcat5:  [  OK  ]
[EMAIL PROTECTED] /]# ps -ef | grep java
tomcat   13918 1 62 02:40 ?00:00:02 
/usr/lib/jvm/java/bin/java 
-Dcatalina.ext.dirs=/usr/share/tomcat5/shared/lib:/usr/share/tomcat5/common/lib 
-Dcatalina.ext.dirs=/usr/share/tomcat5/shared/lib:/usr/share/tomcat5/common/lib 
-Djava.endorsed.dirs=/usr/share/tomcat5/common/endorsed -classpath 
/usr/lib/jvm/java/lib/tools.jar:/usr/share/tomcat5/bin/bootstrap.jar:/usr/share/tomcat5/bin/commons-logging-api.jar:/usr/share/java/mx4j/mx4j-impl.jar:/usr/share/java/mx4j/mx4j-jmx.jar 
-Dcatalina.base=/usr/share/tomcat5 -Dcatalina.home=/usr/share/tomcat5 
-Djava.io.tmpdir=/usr/share/tomcat5/temp 
org.apache.catalina.startup.Bootstrap start


[EMAIL PROTECTED] /]# ps -ef | grep java
root 14011 12038  0 02:40 pts/000:00:00 grep java
[EMAIL PROTECTED] /]# free -m
total   used   free sharedbuffers cached
Mem:   256 20235  0  0  0
-/+ buffers/cache: 20235


As you can see, the first time I ran ps -ef | grep java I could see 
that it's starting up, but the second time, it's not running


I have another terminal open with top running, and the memory usage 
didn't even blink when I ran it





--

Kind Regards
Rudi Ahlers
CEO, SoftDux

Web:   http://www.SoftDux.com
Check out my technical blog, http://blog.softdux.com for Linux or other 
technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stuff

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] can't get Tomcat5 to work on centos 5.1, how do I get it to work?

2008-05-09 Thread Les Mikesell

Rudi Ahlers wrote:

Filipe Brandenburger wrote:

Hi,

On Thu, May 8, 2008 at 6:00 PM, Rudi Ahlers [EMAIL PROTECTED] wrote:
 

Exception in thread main java.lang.OutOfMemoryError: Cannot create



It looks like it's running out of memory when starting more threads.
Did you check if you have enough memory in this server to run Tomcat?
I think you need at least 512MB for it, but I would recommend more.

I know there are some tunings made to the JVM for it to request more
memory. If you do ps -ef | grep java when Tomcat is started you will
see some parameters starting with -X that will specify memory sizes,
check how much it requests. I don't really know how to tweak those,
check the script that starts Tomcat to see if it allows changing them.






What you're saying could be true, but I don't think it's the case.

I have confirmed with the client, and he says that 128MB RAM would be 
enough for his app.


The default config is probably asking for more than that.



[EMAIL PROTECTED] /]# /etc/init.d/tomcat5 restart
Starting tomcat5:  [  OK  ]
[EMAIL PROTECTED] /]# ps -ef | grep java
tomcat   13918 1 62 02:40 ?00:00:02 
/usr/lib/jvm/java/bin/java 
-Dcatalina.ext.dirs=/usr/share/tomcat5/shared/lib:/usr/share/tomcat5/common/lib 
-Dcatalina.ext.dirs=/usr/share/tomcat5/shared/lib:/usr/share/tomcat5/common/lib 
-Djava.endorsed.dirs=/usr/share/tomcat5/common/endorsed -classpath 
/usr/lib/jvm/java/lib/tools.jar:/usr/share/tomcat5/bin/bootstrap.jar:/usr/share/tomcat5/bin/commons-logging-api.jar:/usr/share/java/mx4j/mx4j-impl.jar:/usr/share/java/mx4j/mx4j-jmx.jar 
-Dcatalina.base=/usr/share/tomcat5 -Dcatalina.home=/usr/share/tomcat5 
-Djava.io.tmpdir=/usr/share/tomcat5/temp 
org.apache.catalina.startup.Bootstrap start


[EMAIL PROTECTED] /]# ps -ef | grep java
root 14011 12038  0 02:40 pts/000:00:00 grep java
[EMAIL PROTECTED] /]# free -m
total   used   free sharedbuffers cached
Mem:   256 20235  0  0  0
-/+ buffers/cache: 20235


As you can see, the first time I ran ps -ef | grep java I could see 
that it's starting up, but the second time, it's not running


I have another terminal open with top running, and the memory usage 
didn't even blink when I ran it


What jvm are you running?  Chances are that you will have to install the 
Sun version to run the app(s) so you might want to do that before much 
other troubleshooting.



--
  Les Mikesell
   [EMAIL PROTECTED]
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] can't get Tomcat5 to work on centos 5.1, how do I get it to work?

2008-05-09 Thread Rudi Ahlers



- Message from [EMAIL PROTECTED] -
Date: Fri, 09 May 2008 07:54:42 -0500
From: Les Mikesell [EMAIL PROTECTED]
Reply-To: CentOS mailing list centos@centos.org
 Subject: Re: [CentOS] can't get Tomcat5 to work on centos 5.1, how  
do I get it to work?

  To: CentOS mailing list centos@centos.org



Rudi Ahlers wrote:

Filipe Brandenburger wrote:

Hi,

On Thu, May 8, 2008 at 6:00 PM, Rudi Ahlers [EMAIL PROTECTED] wrote:


Exception in thread main java.lang.OutOfMemoryError: Cannot create



It looks like it's running out of memory when starting more threads.
Did you check if you have enough memory in this server to run Tomcat?
I think you need at least 512MB for it, but I would recommend more.

I know there are some tunings made to the JVM for it to request more
memory. If you do ps -ef | grep java when Tomcat is started you will
see some parameters starting with -X that will specify memory sizes,
check how much it requests. I don't really know how to tweak those,
check the script that starts Tomcat to see if it allows changing them.






What you're saying could be true, but I don't think it's the case.

I have confirmed with the client, and he says that 128MB RAM would   
be enough for his app.


The default config is probably asking for more than that.



[EMAIL PROTECTED] /]# /etc/init.d/tomcat5 restart
Starting tomcat5:  [  OK  ]
[EMAIL PROTECTED] /]# ps -ef | grep java
tomcat   13918 1 62 02:40 ?00:00:02   
/usr/lib/jvm/java/bin/java   
-Dcatalina.ext.dirs=/usr/share/tomcat5/shared/lib:/usr/share/tomcat5/common/lib -Dcatalina.ext.dirs=/usr/share/tomcat5/shared/lib:/usr/share/tomcat5/common/lib -Djava.endorsed.dirs=/usr/share/tomcat5/common/endorsed -classpath /usr/lib/jvm/java/lib/tools.jar:/usr/share/tomcat5/bin/bootstrap.jar:/usr/share/tomcat5/bin/commons-logging-api.jar:/usr/share/java/mx4j/mx4j-impl.jar:/usr/share/java/mx4j/mx4j-jmx.jar -Dcatalina.base=/usr/share/tomcat5 -Dcatalina.home=/usr/share/tomcat5 -Djava.io.tmpdir=/usr/share/tomcat5/temp org.apache.catalina.startup.Bootstrap   
start


[EMAIL PROTECTED] /]# ps -ef | grep java
root 14011 12038  0 02:40 pts/000:00:00 grep java
[EMAIL PROTECTED] /]# free -m
   total   used   free sharedbuffers cached
Mem:   256 20235  0  0  0
-/+ buffers/cache: 20235


As you can see, the first time I ran ps -ef | grep java I could   
see that it's starting up, but the second time, it's not running


I have another terminal open with top running, and the memory usage  
 didn't even blink when I ran it


What jvm are you running?  Chances are that you will have to install
the Sun version to run the app(s) so you might want to do that before
much other troubleshooting.


--
  Les Mikesell
   [EMAIL PROTECTED]
___




Yea, I have upped the RAM to 1024MB, and it's working now.

Is this what you're looking for?
[EMAIL PROTECTED] ~]# java -version
java version 1.4.2
gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)

How / where does one optimize java's usage?



output from top:


top - 09:05:42 up  1:59,  1 user,  load average: 0.02, 0.02, 0.00
Tasks:  30 total,   1 running,  29 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1048576k total,   799828k used,   248748k free,0k buffers
Swap:0k total,0k used,0k free,0k cached

  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
15908 tomcat15   0  595m 134m  35m S0 13.1   0:28.89 java
 5506 mysql 18   0  133m  18m 3992 S0  1.8   0:00.08 mysqld
14282 root  18   0  7440 5420 1600 S0  0.5   0:00.01 miniserv.pl
10132 root  18   0  9144 2884 2200 S0  0.3   0:00.09 sshd
19532 root  18   0 10428 2832 1388 S0  0.3   0:00.00 httpd
 3674 named 25   0 68504 2752 1756 S0  0.3   0:00.00 named
19533 apache25   0 10428 2096  628 S0  0.2   0:00.00 httpd
19535 apache25   0 10428 2096  628 S0  0.2   0:00.00 httpd
19536 apache25   0 10428 2096  628 S0  0.2   0:00.00 httpd
19537 apache25   0 10428 2096  628 S0  0.2   0:00.00 httpd
19538 apache25   0 10428 2096  628 S0  0.2   0:00.00 httpd
19539 apache25   0 10428 2096  628 S0  0.2   0:00.00 httpd
19540 apache25   0 10428 2096  628 S0  0.2   0:00.00 httpd
19541 apache25   0 10428 2096  628 S0  0.2   0:00.00 httpd
11791 postfix   18   0  6820 1868 1496 S0  0.2   0:00.00 qmgr
11789 root  18   0  6700 1768 1408 S0  0.2   0:00.01 master
12080 postfix   18   0  6768 1760 1416 S0  0.2   0:00.00 pickup
25774 root  15   0  2420 1312 1092 S0  0.1   0:00.02 bash
11784 root  18   0  2420 1308 1088 S0  0.1   0:00.03 bash
 1985 root  17   0  2424 1304 1084 S0  0.1   0:00.17 bash
 5470 root  22

Re: [CentOS] can't get Tomcat5 to work on centos 5.1, how do I get it to work?

2008-05-09 Thread Filipe Brandenburger
Hi,

On Fri, May 9, 2008 at 9:06 AM, Rudi Ahlers [EMAIL PROTECTED] wrote:
 Mem:   1048576k total,   799828k used,   248748k free,0k buffers
 Swap:0k total,0k used,0k free,0k cached

You have no swap on the machine! Try adding it. You can do that by
creating a big file with dd and using swapon to start using it.
Try starting Tomcat after that, I'm sure it will work.

HTH,
Filipe
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] can't get Tomcat5 to work on centos 5.1, how do I get it to work?

2008-05-09 Thread Les Mikesell

Rudi Ahlers wrote:




What jvm are you running?  Chances are that you will have to install
the Sun version to run the app(s) so you might want to do that before
much other troubleshooting.





Yea, I have upped the RAM to 1024MB, and it's working now.

Is this what you're looking for?
[EMAIL PROTECTED] ~]# java -version
java version 1.4.2
gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)


Note that gcj is not a full java implementation.  If it works, it might 
be faster, though.



How / where does one optimize java's usage?


The [vm:] section of /etc/tomcat5/workers2.properties looks likely.

--
  Les [EMAIL PROTECTED]

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] can't get Tomcat5 to work on centos 5.1, how do I get it to work?

2008-05-08 Thread Rudi Ahlers

Hi all

A client of ours wants Tomcat 5 to be installed on a CentOS 5 server, I 
naturally just ran yum -y install tomcat5 tomcat5-webapps 
tomcat5-admin-webapps which installed it without any errors. Then I 
typed in service tomcat5 start, and tries to access it as such lynx 
http://localhost:8080/; but keep on getting an error connection refused



[EMAIL PROTECTED] /]# service tomcat5 start
Starting tomcat5: lock file found but no process running for
pid 19684, continuing
  [  OK  ]

I don't see any tomcat errors in /var/log/messages but get this:

[EMAIL PROTECTED] /]# tail -f /var/log/tomcat5/catalina.out
  at 
org.apache.catalina.core.StandardService.start(catalina-5.5.23.jar.sonuy1u1.so)
  at 
org.apache.catalina.core.StandardServer.start(catalina-5.5.23.jar.sonuy1u1.so)
  at 
org.apache.catalina.startup.Catalina.start(catalina-5.5.23.jar.sonuy1u1.so)

  at java.lang.reflect.Method.invoke(libgcj.so.7rh)
  ...2 more
Exception in thread main java.lang.OutOfMemoryError: Cannot create 
additional threads

  at java.lang.Thread.start(libgcj.so.7rh)
  at java.lang.Runtime.runShutdownHooks(libgcj.so.7rh)
  at java.lang.Runtime.exitNoChecks(libgcj.so.7rh)
  at java.lang.Runtime.exitNoChecksAccessor(libgcj.so.7rh)


I don't know Tomcat at all.

Can someone please help me with this?


--

Kind Regards
Rudi Ahlers
CEO, SoftDux

Web:   http://www.SoftDux.com
Check out my technical blog, http://blog.softdux.com for Linux or other 
technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stuff

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] can't get Tomcat5 to work on centos 5.1, how do I get it to work?

2008-05-08 Thread Filipe Brandenburger
Hi,

On Thu, May 8, 2008 at 6:00 PM, Rudi Ahlers [EMAIL PROTECTED] wrote:
 Exception in thread main java.lang.OutOfMemoryError: Cannot create

It looks like it's running out of memory when starting more threads.
Did you check if you have enough memory in this server to run Tomcat?
I think you need at least 512MB for it, but I would recommend more.

I know there are some tunings made to the JVM for it to request more
memory. If you do ps -ef | grep java when Tomcat is started you will
see some parameters starting with -X that will specify memory sizes,
check how much it requests. I don't really know how to tweak those,
check the script that starts Tomcat to see if it allows changing them.

HTH,
Filipe
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos