aspose file tools*
The moose likes Servlets and the fly likes Web App Heap Size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Web App Heap Size" Watch "Web App Heap Size" New topic
Author

Web App Heap Size

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

What is a good way of determining heap sizes for a web application without the obvious 'if you get an out of memory exception increase the heap'? I've been looking at different web hosting companies to host a few of my applications but they all seem to be partially priced based on heap size of the VM for Tomcat. I know the default is 64m but I'd like to know good ways of determining this if possible.

Thanks.


GenRocket - Experts at Building Test Data
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
All the web applications of the tomcat server run within the same JVM.Before starting the tomcat we can set the max heap size for the tomcat and I do not think that we can change that on the fly without bringing down the tomcat.

One more thing I would like to ask as I have never enquired about how the web apps are deployed in tomcat in production.Do they configure the tomcat's JVM's heap size for every application ?


Rahul Bhattacharjee
LinkedIn - Blog
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Originally posted by Rahul Bhattacharjee:
All the web applications of the tomcat server run within the same JVM.Before starting the tomcat we can set the max heap size for the tomcat and I do not think that we can change that on the fly without bringing down the tomcat.


That's not what I asked.

Originally posted by Rahul Bhattacharjee:
One more thing I would like to ask as I have never enquired about how the web apps are deployed in tomcat in production.Do they configure the tomcat's JVM's heap size for every application ?


Please don't hijack this thread. You are more than welcome to start your own thread and this question would be more appropriate in the tomcat forum.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I'm not sure there is an easy way to find out 'per application'.
If you're using container manage connection pooling, or other JNDI resources, then muliple apps under the same container could, potentially be sharing some resources.

Have you looked into profilers like JProbe or Optimizeit?
Load testing while monitoring with a profiler seems like it would give you the most realistic estimate.

I've just started playing around with the JConsole app that ships with Sun's JDK1.5.0. It's got some nice, real time, memory usage graphs.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web App Heap Size