The Jrun 3.02/IIS 4.0/NT 4.0/JVM 1.3.0_02 servers
all seem to run out of memory(JVM configured at
min=max= 512MB) after about 12 hours:

java.lang.OutOfMemoryError
        <<no stack trace available>>

A search of the archives suggested several ways to
save memory:
1) closing all DB objects like result set, prepared
statements, returning all connections to pool

2) setting session time out to a shorter interval:
    currently configued as 20 minutes, change to 15
session.setMaxInactiveInterval(com.adv.jsp.JSPUtil.SESSION_TIMEOUT_SECS);

3) add a session.invalidate() to signout process
4) use session.removeAttrbute() to remove objects
from session when they are no longer needed
5) release remaining references to beans in session:
not using HttpSessionBindingListener but are there
other ways an object in session can still have active
references which would keep it from being garbage
collected?
6) use Jprobe or OptimizeIt
downloading the trial but no experience with the
product yet

and now considering this:
7) change session scope objects to request scope
whereever possible
Would changing  scope of a java bean from
session to request save memory even if it means
creating and garbage collecting the object more
frequently? What are the trade offs of calling the
object's constructor more frequently as a request
scope object but making the object available
immediately for garbage collection as opposed to
making it session scope and delaying the garbage
collection?

For example in the index.jsp:
<jsp:useBean id="product"
class="com.adv.beans.ProductBean" scope="session" />
only creates the ProductBean once per session

could be changed to
<jsp:useBean id="product"
class="com.adv.beans.ProductBean" scope="request" />
which would mean changing session references to
request.getAttribute() throughout the JSP






__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to