You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew Hole <an...@gmail.com> on 2007/10/10 09:19:21 UTC

Diagnosing Tomcat memory usage

I've an java application running under tomcat and in the last week
memory usage increase 50%, from 200M to 400M. I want to know exactly
why this happens. Some suggestion?

Thanks a lot

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Diagnosing Tomcat memory usage

Posted by Dan Armbrust <da...@gmail.com>.
Actually, you have no idea how much your code actually increased it.
You just think it increased 50%, because that is what the OS sees.

If you were using 190 MB of memory before, the JVM may have left your
system usage at 200 MB.

Then, when your app bumps the memory up to 201 MB, the JVM needs to
get more memory from the system.  So it typically doubles what it
currently has allocated.  Thats why you jumped from 200 to 400.

So, while your usage may have only gone up by a few MB, due to a
higher concurrent load, whatever, it looks like it doubled, because
that is how the JVM behaves.  And the JVM will never release that
memory back to the system - it will stay at 400 MB until the next time
you restart it.

If you have a leak, and a few weeks from now, you use up all of the
400 MB, the next jump will probably be 800 MB.

If you want to find out how much memory you are actually using, you
need to look inside the VM, with a tool like "jstat" (part of java).




On 10/10/07, Andrew Hole <an...@gmail.com> wrote:
> I've an java application running under tomcat and in the last week
> memory usage increase 50%, from 200M to 400M. I want to know exactly
> why this happens. Some suggestion?
>
> Thanks a lot
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Diagnosing Tomcat memory usage

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
plug in a profiler,
I use www.yourkit.com, you can get memory stats, like the ones you wish 
for, live.
other profilers will do the job as well
Filip

Andrew Hole wrote:
> I've an java application running under tomcat and in the last week
> memory usage increase 50%, from 200M to 400M. I want to know exactly
> why this happens. Some suggestion?
>
> Thanks a lot
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Diagnosing Tomcat memory usage

Posted by Lyallex <ly...@gmail.com>.
Try Lambda Probe as recommended by other contributors to this list.

http://www.lambdaprobe.org/d/index.htm

I'm no expert with this tool but it's straightforward to install and I
think it may help you out a bit. The System Information/Memory
Utilization thing is particularly fascinating although I don't fully
understandthe output yet.

I also used the JProbe profiller some time ago to profile a running
instance of Weblogic, it had a fantastic real time heap analysis tool
that shows you exactly what's happening at runtime ... 2 million
String objects, where the heck did they come from ? It's not free
though as far as I know.

It might help




On 10/10/07, Andrew Hole <an...@gmail.com> wrote:
> I've an java application running under tomcat and in the last week
> memory usage increase 50%, from 200M to 400M. I want to know exactly
> why this happens. Some suggestion?
>
> Thanks a lot
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org