tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julio Serje (@canada.com)" <jse...@home.com>
Subject Re: Increasing memory problem
Date Sun, 26 Nov 2000 16:37:32 GMT
Hi, Kai.

The problem you are experiencing is a difficult one, as it relates to the
way you allocate and de-allocate your resources in a way the garbage
collector can determine that a resource is not needed anymore.

You say that you're using jdbc. You should make sure that you are properly
(and explicitly) deallocating all resources you create.

a) Connections to the database. If you're not using a connection pool, make
sure your connections are closed.
b) ResultSets AND statements. This is a common problem, you must close()
them in order to let the garbage collector do its work.
example:
rset.close();
stmt.close();
conn.close();

Julio

----- Original Message -----
From: Kai Müller <km@mediadom.de>
To: <tomcat-user@jakarta.apache.org>
Sent: Friday, November 24, 2000 12:35 PM
Subject: Increasing memory problem


> Hi everybody!
>
> My problem is the following:
>
> after I start my application (JSPs read from MySQL) with Tomcat 3.1 the
> used memory of the java processes increases and the number of java
> processes themselves increases if I reload the same site (2 per second),
> reload, reload, reload .... ;-)
>
> The performance goes down, and sometimes Tomcat crashes. The HTML sent
> to the browser is large (about 350 kB). I get several errors
> (OutOfMemory, Response has already been committed,...) and I am
> absolutely confused about it now.
>
> Can anybody help me ? Do you need further information ?
>
> With kind regards
>
> Kai Müller
>
>
> The input.jsp is the following and a global entry for all requests,
> which are handled and forward on a JSP page with the HTML-Codes.
>
> ----------------------------------------------------
> <%@ page errorPage="/error/errorpage.jsp" %>
> <%@ page import="javax.servlet.*" %>
> <%@ page import="javax.servlet.http.*" %>
>
> <%
>    response.setDateHeader("Expires",0);
>    response.setHeader("Pragma","no-cache");
>    response.setHeader("Cache-Control","no-cache,must-revalidate");
> %>
>
>  <jsp:useBean
>    id="requestProc"
>    class="TheRequestClass"
>    scope="session"
>  >
> <%
>      requestProc.initialize(config.getServletContext(), session);
>  %>
> </jsp:useBean>
>
>  <jsp:useBean
>    id="pageController"
>    class="ThePageControllerClass"
>    scope="session"
>  >
> </jsp:useBean>
>
>
>  <%
>    requestProc.processRequest(request);
>
>    String next = pageController.getNextPage(request);
>    getServletConfig().getServletContext().getRequestDispatcher("/" +
> next).forward(request, response);
>  %>
> -----------------------------------------------------
> --
>
> Mediadom audiovisuelle Medien GmbH
> Merheimer Str. 151
> D-50733 Koeln
>
> Tel.: 0221 / 917 11 80
> Fax: 0221 / 917 11 81
>
> Internet: http://www.mediadom.de
>
>


Mime
View raw message