You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rich <ri...@streetmail.com> on 2002/05/07 18:47:14 UTC

Problems with memory

Hello all,

I have a fairly complex web application that appears to have a memory issue.
I've come to this conclusion by making requests to my application while
watching 'top' output. In an attempt to track this down, I made the servlet
simpler by stripping out functionality. I continued doing this until what
I'm now left with is a "Hello world" servlet. Even with this simple program,
it still appears as though I have a memory leak. Its not much, but "top"
shows an increase in memory consumption ever 5-10 requests. Finally, I just
started requesting the tomcat-docs resource ... and I get the same thing!
Again, the increase in memory usage to shows is small however the increase
does appear to be there.

Am I interpreting these results incorrectly? I am at a loss as to how to
track down a memory issue in my own servlets, if I can't start at some
baseline.

I'm running Tomcat version 4.0.3 on Linux Redhat version 6.2

Thank you,

Rich


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Problems with memory

Posted by Rich <ri...@streetmail.com>.
Thanks so much for your comments.

One thing I have yet to do is a stress test. I may set that up today. My
testing the other day using 'top' did not show memory usage to decrease;
however I did not watch it over a long period of time. I'm thinking the mem
increase with tomcat-docs and my hello world servelt is benign. I do think I
have a problem with my web application though as this increase is rather
significant. Strange thing is, memory usage increases over time no matter
what page (servlet) I request. Lots of places were there could be a memory
problem: my code, velocity servlet engine, JDBC mysql driver, etc.


Oh, I should of also mentioned I'm using. jdk 1.3.1.

Maybe I'll try jdk version 1.4 too

I'll let you know what I find, when I find it.

Rich

-----Original Message-----
From: Oki DZ [mailto:okidz@pindad.com]
Sent: Tuesday, May 07, 2002 9:15 PM
To: Tomcat Users List
Subject: Re: Problems with memory


On 05/07 23:47 Rich wrote:
...
> I'm now left with is a "Hello world" servlet. Even with this simple
program,
> it still appears as though I have a memory leak. Its not much, but "top"
> shows an increase in memory consumption ever 5-10 requests. Finally, I
just
> started requesting the tomcat-docs resource ... and I get the same thing!
> Again, the increase in memory usage to shows is small however the increase
> does appear to be there.

Question is, did the memory usage go down some time later...? If there were
memory leak, then it wouldn't; it would just keep growing and growing until
the Tomcat's JVM get kicked out due to no swapspace left. I think it would
be
good to test whether the JVM was leaking; try to set the swap space smaller
(or none if your system could be booted with the necessary services running)
and have Tomcat gets lots of requests; and see what happens.

> Am I interpreting these results incorrectly? I am at a loss as to how to
> track down a memory issue in my own servlets, if I can't start at some
> baseline.

You don't have to fix your servlets on memory leaks; because it's not your
problem. It's the JVM's (if there were memory leak at all).

> I'm running Tomcat version 4.0.3 on Linux Redhat version 6.2

I'm running Tomcat 4.03 too, with Sun's JDK 1.4 on a Debian (sid) machine. I
have just tried to run top and had some request on a servlet; the memory
usage
is going pretty naturally. Well, in fact, I run James mail server
(Java-based)
on that machine too; it seems to be allright.

Oki

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problems with memory

Posted by Oki DZ <ok...@pindad.com>.
On 05/07 23:47 Rich wrote:
...
> I'm now left with is a "Hello world" servlet. Even with this simple program,
> it still appears as though I have a memory leak. Its not much, but "top"
> shows an increase in memory consumption ever 5-10 requests. Finally, I just
> started requesting the tomcat-docs resource ... and I get the same thing!
> Again, the increase in memory usage to shows is small however the increase
> does appear to be there.

Question is, did the memory usage go down some time later...? If there were 
memory leak, then it wouldn't; it would just keep growing and growing until 
the Tomcat's JVM get kicked out due to no swapspace left. I think it would be 
good to test whether the JVM was leaking; try to set the swap space smaller 
(or none if your system could be booted with the necessary services running) 
and have Tomcat gets lots of requests; and see what happens.

> Am I interpreting these results incorrectly? I am at a loss as to how to
> track down a memory issue in my own servlets, if I can't start at some
> baseline.

You don't have to fix your servlets on memory leaks; because it's not your 
problem. It's the JVM's (if there were memory leak at all).

> I'm running Tomcat version 4.0.3 on Linux Redhat version 6.2

I'm running Tomcat 4.03 too, with Sun's JDK 1.4 on a Debian (sid) machine. I 
have just tried to run top and had some request on a servlet; the memory usage 
is going pretty naturally. Well, in fact, I run James mail server (Java-based) 
on that machine too; it seems to be allright.

Oki

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>