You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "LILES, DAVID (CONTRACTOR)" <DA...@DFAS.MIL> on 2004/04/02 17:49:33 UTC

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


Re: Memory Leak Solution?

Posted by Antonio Fiol BonnĂ­n <fi...@terra.es>.
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 
> <jo...@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
>
>


RE: Memory Leak Solution?

Posted by John Thompson <jo...@start-thinking.com>.
It was basically a bug in my code that I'm not proud of but the point is
that I found it with the profiler.  It showed me exactly which class
continued to absorb memory.  It also showed me what memory allocation looked
like for the whole JVM.

-----Original Message-----
From: Malcolm Warren [mailto:malcolm@villeinitalia.com] 
Sent: Friday, April 02, 2004 10:53 AM
To: Tomcat Users List
Subject: Re: Memory Leak Solution?

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 
<jo...@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


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Memory Leak Solution?

Posted by Malcolm Warren <ma...@villeinitalia.com>.
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 
<jo...@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


RE: Memory Leak Solution?

Posted by John Thompson <jo...@start-thinking.com>.
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