You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Roy K. Mayr R." <sy...@uapar.edu> on 2001/08/26 03:25:00 UTC

Memory used by java process

Hi,

I'm working with Solaris 8, Tomcat 3.3b, jdk 1.3.1, and Apache...

When I start tomcat, java process use 16M and when I run JSP pages this
process grow more, more, more....

I start java with options:

export TOMCAT_OPTS=" -server -verbosegc -Xincgc -Xmx150m"

What is wrong??

Output of "verbosegc" is:

[GC 2048K->315K(2368K), 0.0462030 secs]
[GC 2363K->700K(2816K), 0.0608491 secs]
[GC 2748K->892K(3072K), 0.0341915 secs]
[Full GC 2532K->1166K(2944K), 0.1949014 secs]
[Full GC 1182K->1166K(2944K), 0.1618361 secs]
[Full GC 1182K->1166K(2944K), 0.1584852 secs]
[Full GC 1182K->1165K(2944K), 0.1936703 secs]
[Full GC 1181K->1165K(2944K), 0.1533219 secs]
[Full GC 1181K->1165K(2944K), 0.1563846 secs]
[Full GC 1181K->1166K(2944K), 0.1545294 secs]
[Full GC 1182K->1165K(2944K), 0.1559197 secs]
[Full GC 1181K->1165K(2944K), 0.1528804 secs]
[Full GC 1181K->1166K(2944K), 0.1569995 secs]
[Full GC 1182K->1165K(2944K), 0.1563494 secs]
[Full GC 1181K->1165K(2944K), 0.1603762 secs]
[Full GC 1181K->1165K(2944K), 0.1538769 secs]
[Full GC 1181K->1165K(2944K), 0.1532354 secs]
[Full GC 1181K->1165K(2944K), 0.1560933 secs]
[Full GC 1181K->1165K(2944K), 0.1897674 secs]
[Full GC 1181K->1165K(2944K), 0.1539893 secs]
[Full GC 1181K->1165K(2944K), 0.1579279 secs]
[Full GC 1181K->1165K(2944K), 0.1608534 secs]
[Full GC 1181K->1165K(2944K), 0.1537858 secs]
[Full GC 1181K->1165K(2944K), 0.1563487 secs]
[Full GC 1181K->1165K(2944K), 0.1607285 secs]
[Full GC 1181K->1165K(2944K), 0.1566505 secs]
[Full GC 1181K->1165K(2944K), 0.1559282 secs]
[Full GC 1181K->1165K(2944K), 0.1530489 secs]
[Full GC 1181K->1165K(2944K), 0.1607813 secs]
[Full GC 1181K->1165K(2944K), 0.1538563 secs]
...

And finaly, every page that I see, output:

[GC 6976K->6516K(7232K), 0.0142359 secs]
[GC 7021K->6564K(7232K), 0.0164692 secs]
[GC 7076K->6643K(7360K), 0.0208976 secs]
....

What it means ??

Roy


Re: Memory used by java process

Posted by Vladimir Grishchenko <vl...@hotmail.com>.
As long as the growing process stops at some point it's fine.
Java is dynamic by nature, meaning the classes are loaded
on demand, not proactively. Jsp pages are compiled
into servlets and get loaded only as needed, that's why
process size is growing with time. Try -verbose
options to see how many classes get loaded per request.
You're also generating objects yourself in servlets/Jsp's.
Some of them are long lived, which contributes to growing
heap/process size. Another thing is that VM doesn't give
all memory back even after it's reclaimed by GC.

 If it keeps growing
without bounds most likely you have a memory leak
somewhere, meaning some objects cannot be reclaimed by
GC because they are strongly reachable. 

Also, the -Xincgc option you use enables "train" or incremental
garbage collection, which from my experience makes
GC less aggressive in general (this is what it's meant for anyway),
 which translates into larger Java process/heap size but less
noticeable GC pauses.

Hope this helps,
--V.


----- Original Message ----- 
From: "Roy K. Mayr R." <sy...@uapar.edu>
To: <to...@jakarta.apache.org>
Sent: Saturday, August 25, 2001 6:25 PM
Subject: Memory used by java process


> Hi,
> 
> I'm working with Solaris 8, Tomcat 3.3b, jdk 1.3.1, and Apache...
> 
> When I start tomcat, java process use 16M and when I run JSP pages this
> process grow more, more, more....
> 
> I start java with options:
> 
> export TOMCAT_OPTS=" -server -verbosegc -Xincgc -Xmx150m"
> 
> What is wrong??
> 
> Output of "verbosegc" is:
> 
> [GC 2048K->315K(2368K), 0.0462030 secs]
> [GC 2363K->700K(2816K), 0.0608491 secs]
> [GC 2748K->892K(3072K), 0.0341915 secs]
> [Full GC 2532K->1166K(2944K), 0.1949014 secs]
> [Full GC 1182K->1166K(2944K), 0.1618361 secs]
> [Full GC 1182K->1166K(2944K), 0.1584852 secs]
> [Full GC 1182K->1165K(2944K), 0.1936703 secs]
> [Full GC 1181K->1165K(2944K), 0.1533219 secs]
> [Full GC 1181K->1165K(2944K), 0.1563846 secs]
> [Full GC 1181K->1166K(2944K), 0.1545294 secs]
> [Full GC 1182K->1165K(2944K), 0.1559197 secs]
> [Full GC 1181K->1165K(2944K), 0.1528804 secs]
> [Full GC 1181K->1166K(2944K), 0.1569995 secs]
> [Full GC 1182K->1165K(2944K), 0.1563494 secs]
> [Full GC 1181K->1165K(2944K), 0.1603762 secs]
> [Full GC 1181K->1165K(2944K), 0.1538769 secs]
> [Full GC 1181K->1165K(2944K), 0.1532354 secs]
> [Full GC 1181K->1165K(2944K), 0.1560933 secs]
> [Full GC 1181K->1165K(2944K), 0.1897674 secs]
> [Full GC 1181K->1165K(2944K), 0.1539893 secs]
> [Full GC 1181K->1165K(2944K), 0.1579279 secs]
> [Full GC 1181K->1165K(2944K), 0.1608534 secs]
> [Full GC 1181K->1165K(2944K), 0.1537858 secs]
> [Full GC 1181K->1165K(2944K), 0.1563487 secs]
> [Full GC 1181K->1165K(2944K), 0.1607285 secs]
> [Full GC 1181K->1165K(2944K), 0.1566505 secs]
> [Full GC 1181K->1165K(2944K), 0.1559282 secs]
> [Full GC 1181K->1165K(2944K), 0.1530489 secs]
> [Full GC 1181K->1165K(2944K), 0.1607813 secs]
> [Full GC 1181K->1165K(2944K), 0.1538563 secs]
> ...
> 
> And finaly, every page that I see, output:
> 
> [GC 6976K->6516K(7232K), 0.0142359 secs]
> [GC 7021K->6564K(7232K), 0.0164692 secs]
> [GC 7076K->6643K(7360K), 0.0208976 secs]
> ....
> 
> What it means ??
> 
> Roy
> 
>