aspose file tools*
The moose likes Tomcat and the fly likes Tomcat memory utilization question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat memory utilization question" Watch "Tomcat memory utilization question" New topic
Author

Tomcat memory utilization question

Jeremy Wilkinson
Greenhorn

Joined: Mar 31, 2010
Posts: 13
I have been developing web applications, bundling as WAR's, and deploying to Tomcat version 6. My production server is configured to receive requests on a Apache server and redirect to Tomcat with AJP1.3. Aside from a few configuration changes to support higher volumes, virtual hosts, and different listener ports, I am baffled by the amount of memory being consumed at deployment or restart of my tomcat instance. I have 13 different web apps I would like to deploy on this Tomcat instance, but keep running out of memory when trying to deploy more than 9. I have increased the memory options to a max of 512m but am wondering if I am missing something or have configured something wrong because my test server Tomcat instance is configured with a 64m max and has all 13 apps deployed and starts just fine.

Can anyone point me in an direction that will help me better understand why 64 meg will allow for deployment of 13 web apps, but those same 13 will not deploy with an instance setup for 512 meg?

Also, I have created another instance to support the apps that I can not deploy on my primary instance but assume I will run into the same problem once I start adding more web apps to that one too. So I started setting up another instance of Tomcat and it will not start and fails with the following error.

Caused by: java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.<init>(ThreadPool.java:649)
at org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:521)
at org.apache.tomcat.util.threads.ThreadPool.start(ThreadPool.java:150)
at org.apache.jk.common.ChannelSocket.init(ChannelSocket.java:436)
at org.apache.jk.server.JkMain.start(JkMain.java:370)
at org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:144)
at org.apache.catalina.connector.Connector.start(Connector.java:1087)
at org.apache.catalina.core.StandardService.start(StandardService.java:534)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
... 6 more

Any help would be greatly appreciated.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Have you used the Management App to check on how many request threads are running and the change in memory use?

That Thread problem sounds like you have a bunch of Threads that are hung somewhere - I had this happen when requests were waiting for a resource that was no longer available.

Bill
Jeremy Wilkinson
Greenhorn

Joined: Mar 31, 2010
Posts: 13
Yes... I have watched the existing apps run in the manager and I have seen garbage collection work. Do you have any idea why one instance on one machine will work fine when deploying 13+ apps with a max heap of 64meg for memory, but those on another with 512 meg will not deploy those same 13 apps. The only difference really is the fact that I use AJP13 to connect my Apache web server to the Tomcat. Do you know anything about AJP holding threads?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat memory utilization question