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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to