DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21176>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21176

Continuous Memory Leaks

           Summary: Continuous Memory Leaks
           Product: Tomcat 4
           Version: 4.1.24
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Unknown
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I experiment frequent memory leaks using servlets with Tomcat.

As a simple test, i wrote this servlet:

import java.io.*;
import java.util.* ;

import javax.servlet.*;
import javax.servlet.http.*;

public class TestServlet extends HttpServlet {

  int liCount = 0 ;
    
  public void doGet(HttpServletRequest request, HttpServletResponse response) 
throws ServletException {

    try  {
        Runtime lRuntime = Runtime.getRuntime();

        StringBuffer lOut = new StringBuffer();
        lOut.append("Loop,") ;
        lOut.append((++liCount)) ;
        lOut.append(",Total,") ;
        lOut.append(lRuntime.totalMemory()) ;
        lOut.append(",Used,") ;
        lOut.append(lRuntime.totalMemory() - lRuntime.freeMemory()) ;
        lOut.append(",Free,") ;
        lOut.append(lRuntime.freeMemory()) ;  
        
        System.out.println(lOut.toString());
    } catch (Exception ex)  {
    }
    
  }  

}

Examining the results, you can easily find out that memory usage keeps growing 
constantly.

Memory usage starts from 18.528.360 and, after about 10.000 iterations reaches 
32.509.816

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to