Hello. I do not know if this is the right plce to post this question, but I
have seen some others having the same problem with other Application
servers/servlet enginges....

Symptom:
Server is up and running in about one day, then it crashes, because the
server runs out of available memory.

Description:
After a bit of memory debugging, it seems that our servlets and all depended
classes are almost GC'ed. But there always remains a 20 byte reference to
the servlet and all depended classes. So if your servlet is somewhat
complicated, this will eat your memory by 4K for every hit to your servlet.
when the memory consumption reashes the heap roof, Garbage-Collection takes
place, and the heap is enlarged.And so it continues from the beginning until
it runs of of heap space again.
Again and again, until the heap can grow no more, and the JVM stops
responding, often taking the OS down too.
I have tried with a veeeeery simple servlet wich does nothing, and he same
symptoms appear here.

Simple source:
public class SimpleServlet extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse res) {
         res.setContentType("text/plain");
         res.setStatus(res.SC_OK);
         PrintWriter out = res.getWriter();
         out.println("servlet worked, and now we have 20 bytes less
memory.");
         out.flush();
         out.close();
         return;
    }
}




Partial solution:
The only solution so far for this problem has been twofolded:
1. take a restart every day.
or
2. have a thread running in the background doing a manual GC every now and
then.

None of these solutions are good ones. So if someone can point out to as
what we are doing wrong, or show us a workaround, lives will definentily be
much easier.

(PS. we are using SilverStream Application Server v. 3.7,
Java JRE 1.3.0 with HotSpot VM 1.3.0-C, mixed mode)


Best regard Frank Karlstr�m
Web-developer/Java programmer

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to