tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Fiol BonnĂ­n <fiol.bon...@terra.es>
Subject Re: Memory Leak Solution?
Date Fri, 02 Apr 2004 17:45:10 GMT
public interface MemoryLeak {
public void leak();
}

---------------------

import java.util.Vector;
public class C implements MemoryLeak {
Vector v = new Vector();
public void leak() {
v.add(new Object());
}
}

-------------------------

public class MyLeakerServlet extends javax.servlet.http.HttpServlet {
C lk = new C();
public void doGet(javax.servlet.http.HttpServletRequest req, 
javax.servlet.http.HttpServletResponse res) {
  lk.leak();
  res.getWriter().println("I'm leaking!!");
}
}

;-)

Antonio Fiol

Malcolm Warren wrote:

> I'd be very interested to hear how one can allocate memory without it 
> being de-referenced.
> It's obviously something to avoid. Can you give a bit of detail?
>
> Thanks.
>
>
> On Fri, 2 Apr 2004 10:28:22 -0600, John Thompson 
> <john-tomcat@start-thinking.com> wrote:
>
>> I've been fighting a similar symptom.  I downloaded the eval copy of
>> JProfiler and found the problem pretty quickly.  I had some static 
>> classes
>> that kept allocating memory that never got de-referenced.
>>
>> John
>>
>> -----Original Message-----
>> From: LILES, DAVID (CONTRACTOR) [mailto:DAVID.LILES@DFAS.MIL]
>> Sent: Friday, April 02, 2004 9:50 AM
>> To: tomcat-user@jakarta.apache.org
>> Subject: Memory Leak Solution?
>>
>> I've searched previous postings for a possible solution regarding the 
>> memory
>> leak thread that was posted previously but didn't seem to find an 
>> answer.
>>
>> I'm running TC5 on IIS5 and have noticed that the memory gradually 
>> decreases
>> to the point where the server needs to be rebooted.
>>
>> Does anyone know of a solution for this?
>>
>> Thanks.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


Mime
View raw message