Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat Won't Start on Linux

Status
Not open for further replies.

hundel

Programmer
Jun 10, 2003
15
US
When starting an empty/basic standalone Tomcat 5.5 on Linux kernel 2.4.1, GLIBC 2.3, with Java 1.5.0 and LD_ASSUME_KERNEL=2.2.5 we receive the following exception. Removing LD_ASSUME_KERNEL resolves the problem, but the release notes specify it, and we've heard the server could lock up without it. Thoughts?

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Caused by: java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:574)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.<init>(ThreadPool.java:643)
at org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:515)
at org.apache.tomcat.util.threads.ThreadPool.start(ThreadPool.java:148)
at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java:315)
at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:176)
at org.apache.catalina.connector.Connector.start(Connector.java:992)
at org.apache.catalina.core.StandardService.start(StandardService.java:459)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2010)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
... 6 more
 
Have you tried invoking the JVM with a switch to give the JVM more memory (-Xms256m -Xmx256m - you'll need to hack the catalina.sh to do this) ?

Where have you *heard* that the JVM will lock if you don't specify this env var ?

Click here to learn Ways to help with Tsunami Relief
--------------------------------------------------
Free Database Connection Pooling Software
 
Thanks sedj -

We're specifying -Xmx much higher than 256m, but from my reading online, "unable to create new native thread" is not really related to heap size.

There's a good amount of detail online regarding how Linux upgraded their threading model, causing java's monitor to stop letting new threads into synchronized sections (we've experienced it) and this is the apparent reason for the Tomcat release note specifying LD_ASSUME_KERNEL=2.2.5 for glibc v2.2 - it reverts the Linux thread model to an older version that is more friendly to Java.
 
Its funny ... I've not yet tried 5.5, am on 5.0.25, but have seen a couple of posts here with people with similar problems, even on Windows ... I think I'll leave 5.5 for a while !

Like you, I'm sure its not a heap problem, but you never know ! Perhaps contact your vendor ?

Click here to learn Ways to help with Tsunami Relief
--------------------------------------------------
Free Database Connection Pooling Software
 
sedj - Sadly, this occured first on Tomcat 5.0. Upgrade to 5.5 was our first attempt to resolve the issue. Also, other Linux servers can successfully run this configuration. They seem to have a slightly different Linux patchset.
 
Red Hat Enterprise Linux ES release 3 (Taroon Update 3)

Linux webforms05 2.4.21-20.ELsmp #1 SMP Wed Aug 18 20:46:40 EDT 2004 i686 i686 i386 GNU/Linux

 
LD_ASSUME_KERNEL=2.4.1 works like a charm, but Tomcat documentation prescribes that for Redhat Linux 9.
 
Apparently, it is related to the latest kernel patchset. We're going to upgrade a working server to that patchset and confirm. If that's the case, we're going to have to do a lot of testing to confirm 2.4.1 is a stable threading model for Tomcat on our version of Linux. We have been through the horrible thread deadlocking that occurs when Tomcat is run in a high-use production setting on Linux and the thread model is not reverted as required in the release notes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top