Good question.  In a 1.1 JVM from Sun, 16 MB is the default max heap size.  They
got a little more realistic with 1.2 and made it 64 MB.  But for enterprise
apps, you're likely to want it in the 100s of MBs or more, depending on your
needs and resources.

IBM, on the other hand, sets their JVMs to use 1/2 the physical memory size, by
default.

Basically, you need to do some monitoring on your part to see what you need.
There's no point in blindly setting the max heap size to some arbitrary value.
There's no harm in setting it real high either though, since if you don't need
it, it won't ever get allocated.  Just make sure you leave enough for the other
apps on your machine.

Min heap size is a subject of some interest.  Should you keep it low (default is
1 MB) or set it high?   IBM wrote a paper that suggested setting the min and max
heap to the same value helped with performance on a server-side app.  But you've
got to experiment to see what works best for you.

Scott Stirling

----- Original Message -----
From: Phil Swenson <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 17, 2000 12:44 PM
Subject: Java VM max heap size


> We are using New Atlanta's Servlet Exec.  It works great but after 1 day up
> being up we got an out of memory error.  New Atlanta suggested boosting the
> Java VM max heap size to 64Meg from 16 meg.  My question is why would it
> default only 16meg?  And why only boost to 64 meg?  The server currently has
> 256 meg of memory, why not boost the max heap to something close to the
> amount of physical memory(or even higher)?

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to