You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Shannon Scott <ss...@gwi.net> on 2004/09/23 17:19:35 UTC

Tomcat dies at 167M

Greetings,
Tomcat is running, and was working fine until the memory usage went up
to 167, now none of the .jsp pages will respond ( the server hangs
forever ).
The last entries from the Catalina.out are :
java.lang.OutOfMemoryError
java.lang.OutOfMemoryError
java.lang.OutOfMemoryError
 
I don't understand how the JVM could be our of memory because I set it
to use 256M.  
So the last time this happened, I wrote a piece of code that would leak
some memory thinking that might be somehow related, but the tomcat
process used more than 167M when I tested that page.
 
 
I have set the CATALINA_OPTS="-Xms64M -Xmx256M", and everything looks
right when I list the processes.
ps -elf | grep tomcat :
 
0 S tomcat4  17629     1  0  85   0    - 315671 schedu Sep21 ?
00:00:04 /usr/java/j2sdk1.4.2_03/bin/java -Xms64M -Xmx256M.
 
However, after the system shows 167M in top, tomcat no longer responds.
None of the tomcat logs are written to, and I find this in the mod_jk
log :
 
[Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (738)]: ERROR: can't
receive the response message from tomcat, network problems or tomcat is
down. err=-104
[Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1137)]: Error reading
reply from tomcat. Tomcat is down or network problems.
[Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1290)]: ERROR: Receiving
from tomcat failed, recoverable operation. err=0
[Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1309)]: sending request to
tomcat failed in send loop. err=0
 
top output :
 
  PID    USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU
COMMAND
17629  tomcat4   25    0  167M 140M 12484 S     0.0  6.9  15:40   0 java
 
RedHat Linux ES 3.0
Apache 2.0.46 with ( mod_jk )
Tomcat 4.1.24
Sun j2sdk 1.4.2_03
 
I am confused.  Any help is greatly appreciated.  Please let me know if
I can provide any more informative details.  
Thank you for your time.
Take Care.
Shannon
 
PS
I have searched list archives and read the docs about tomcat
OutOfMemoryError, but none seem to address my problem.

Re: Tomcat dies at 167M

Posted by QM <qm...@brandxdev.net>.
On Mon, Sep 27, 2004 at 11:56:03AM -0400, Shannon Scott wrote:
: I tried :
:  lsof -u tomcat4 > lsof.txt
: 
: And that returned about 10000 lines.  Does that seem right?

That very well could be; the output includes physical files (shared
libs and the like), sockets, etc.

If you are indeed running out of sockets, search the archives for a
recent post of mine.  I provided a couple of pointers on how to make the
system release "closed" sockets faster, which is a common technique for
tuning servers for short/bursty traffic (aka HTTP).

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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


RE: Tomcat dies at 167M

Posted by Shannon Scott <ss...@gwi.net>.
Thank you for helping.

What should I expect for lsof output?
I tried :
 lsof -u tomcat4 > lsof.txt

And that returned about 10000 lines.  Does that seem right?
Thank you again.
Take Care.
Shannon


-----Original Message-----
From: emmett [mailto:emmettc@gmail.com] 
Sent: Friday, September 24, 2004 12:55 PM
To: Tomcat Users List
Subject: Re: Tomcat dies at 167M

It's possible that you are out of file descriptors.
Find and use 'lsof' (ls open files) running it against that process.
I've seen Java report OOM when it can not allocate a file because
a File is nothing more than another object associated with the resource.

If this is the case you will have to figure out where you are not
releasing
files or sockets and resolve the problem. 



On Thu, 23 Sep 2004 11:19:35 -0400, Shannon Scott <ss...@gwi.net>
wrote:
> Greetings,
> Tomcat is running, and was working fine until the memory usage went up
> to 167, now none of the .jsp pages will respond ( the server hangs
> forever ).
> The last entries from the Catalina.out are :
> java.lang.OutOfMemoryError
> java.lang.OutOfMemoryError
> java.lang.OutOfMemoryError
> 
> I don't understand how the JVM could be our of memory because I set it
> to use 256M.
> So the last time this happened, I wrote a piece of code that would
leak
> some memory thinking that might be somehow related, but the tomcat
> process used more than 167M when I tested that page.
> 
> I have set the CATALINA_OPTS="-Xms64M -Xmx256M", and everything looks
> right when I list the processes.
> ps -elf | grep tomcat :
> 
> 0 S tomcat4  17629     1  0  85   0    - 315671 schedu Sep21 ?
> 00:00:04 /usr/java/j2sdk1.4.2_03/bin/java -Xms64M -Xmx256M.
> 
> However, after the system shows 167M in top, tomcat no longer
responds.
> None of the tomcat logs are written to, and I find this in the mod_jk
> log :
> 
> [Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (738)]: ERROR: can't
> receive the response message from tomcat, network problems or tomcat
is
> down. err=-104
> [Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1137)]: Error reading
> reply from tomcat. Tomcat is down or network problems.
> [Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1290)]: ERROR: Receiving
> from tomcat failed, recoverable operation. err=0
> [Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1309)]: sending request
to
> tomcat failed in send loop. err=0
> 
> top output :
> 
>  PID    USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU
> COMMAND
> 17629  tomcat4   25    0  167M 140M 12484 S     0.0  6.9  15:40   0
java
> 
> RedHat Linux ES 3.0
> Apache 2.0.46 with ( mod_jk )
> Tomcat 4.1.24
> Sun j2sdk 1.4.2_03
> 
> I am confused.  Any help is greatly appreciated.  Please let me know
if
> I can provide any more informative details.
> Thank you for your time.
> Take Care.
> Shannon
> 
> PS
> I have searched list archives and read the docs about tomcat
> OutOfMemoryError, but none seem to address my problem.
> 
>

---------------------------------------------------------------------
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: Tomcat dies at 167M

Posted by emmett <em...@gmail.com>.
It's possible that you are out of file descriptors.
Find and use 'lsof' (ls open files) running it against that process.
I've seen Java report OOM when it can not allocate a file because
a File is nothing more than another object associated with the resource.

If this is the case you will have to figure out where you are not releasing
files or sockets and resolve the problem. 



On Thu, 23 Sep 2004 11:19:35 -0400, Shannon Scott <ss...@gwi.net> wrote:
> Greetings,
> Tomcat is running, and was working fine until the memory usage went up
> to 167, now none of the .jsp pages will respond ( the server hangs
> forever ).
> The last entries from the Catalina.out are :
> java.lang.OutOfMemoryError
> java.lang.OutOfMemoryError
> java.lang.OutOfMemoryError
> 
> I don't understand how the JVM could be our of memory because I set it
> to use 256M.
> So the last time this happened, I wrote a piece of code that would leak
> some memory thinking that might be somehow related, but the tomcat
> process used more than 167M when I tested that page.
> 
> I have set the CATALINA_OPTS="-Xms64M -Xmx256M", and everything looks
> right when I list the processes.
> ps -elf | grep tomcat :
> 
> 0 S tomcat4  17629     1  0  85   0    - 315671 schedu Sep21 ?
> 00:00:04 /usr/java/j2sdk1.4.2_03/bin/java -Xms64M -Xmx256M.
> 
> However, after the system shows 167M in top, tomcat no longer responds.
> None of the tomcat logs are written to, and I find this in the mod_jk
> log :
> 
> [Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (738)]: ERROR: can't
> receive the response message from tomcat, network problems or tomcat is
> down. err=-104
> [Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1137)]: Error reading
> reply from tomcat. Tomcat is down or network problems.
> [Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1290)]: ERROR: Receiving
> from tomcat failed, recoverable operation. err=0
> [Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1309)]: sending request to
> tomcat failed in send loop. err=0
> 
> top output :
> 
>  PID    USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU
> COMMAND
> 17629  tomcat4   25    0  167M 140M 12484 S     0.0  6.9  15:40   0 java
> 
> RedHat Linux ES 3.0
> Apache 2.0.46 with ( mod_jk )
> Tomcat 4.1.24
> Sun j2sdk 1.4.2_03
> 
> I am confused.  Any help is greatly appreciated.  Please let me know if
> I can provide any more informative details.
> Thank you for your time.
> Take Care.
> Shannon
> 
> PS
> I have searched list archives and read the docs about tomcat
> OutOfMemoryError, but none seem to address my problem.
> 
>

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


Re: Tomcat dies at 167M

Posted by QM <qm...@brandxdev.net>.
On Thu, Sep 23, 2004 at 12:14:24PM -0500, Jacob Kjome wrote:
: Ahh... Then I eat my words.  Sorry about that.  I don't know why I remembered
: the case as being important?

Depends on the vendor/version of the JDK... just as some care about the
space or equals-sign between the flag and its arg.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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


Re: Tomcat dies at 167M

Posted by Jacob Kjome <ho...@visi.com>.
Quoting Dale Lum <da...@gmail.com>:

> > Well it could be because "-Xmx256M" means absolutely nothing to the VM.
> You
> > need to use "-Xmx256m".  Notice the case of the "m".  It is *very*
> important.
>
> Not according to the docs:
>

Ahh... Then I eat my words.  Sorry about that.  I don't know why I remembered
the case as being important?

Jake


> -Xmxn
>     Specify the maximum size, in bytes, of the memory allocation pool.
> This value must a multiple of 1024 greater than 2MB. Append the letter
> k or K to indicate kilobytes, or m or M to indicate megabytes. The
> default value is 64MB. The upper limit for this value will be
> approximately 4000m on Solaris 7 and Solaris 8 SPARC platforms and
> 2000m on Solaris 2.6 and x86 platforms, minus overhead amounts.
> Examples:
>
>        -Xmx83886080
>        -Xmx81920k
>        -Xmx80m
>
> ---------------------------------------------------------------------
> 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: Tomcat dies at 167M

Posted by Dale Lum <da...@gmail.com>.
> Well it could be because "-Xmx256M" means absolutely nothing to the VM.  You
> need to use "-Xmx256m".  Notice the case of the "m".  It is *very* important.

Not according to the docs:

-Xmxn
    Specify the maximum size, in bytes, of the memory allocation pool.
This value must a multiple of 1024 greater than 2MB. Append the letter
k or K to indicate kilobytes, or m or M to indicate megabytes. The
default value is 64MB. The upper limit for this value will be
approximately 4000m on Solaris 7 and Solaris 8 SPARC platforms and
2000m on Solaris 2.6 and x86 platforms, minus overhead amounts.
Examples:

       -Xmx83886080
       -Xmx81920k
       -Xmx80m

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


Re: Tomcat dies at 167M

Posted by Jacob Kjome <ho...@visi.com>.
Quoting Shannon Scott <ss...@gwi.net>:

> Greetings,
> Tomcat is running, and was working fine until the memory usage went up
> to 167, now none of the .jsp pages will respond ( the server hangs
> forever ).
> The last entries from the Catalina.out are :
> java.lang.OutOfMemoryError
> java.lang.OutOfMemoryError
> java.lang.OutOfMemoryError
>
> I don't understand how the JVM could be our of memory because I set it
> to use 256M.
> So the last time this happened, I wrote a piece of code that would leak
> some memory thinking that might be somehow related, but the tomcat
> process used more than 167M when I tested that page.
>
>
> I have set the CATALINA_OPTS="-Xms64M -Xmx256M", and everything looks

Well it could be because "-Xmx256M" means absolutely nothing to the VM.  You
need to use "-Xmx256m".  Notice the case of the "m".  It is *very* important.

Jake

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


SUM: Tomcat dies at 167M

Posted by Shannon Scott <ss...@gwi.net>.
Thank you all who sent help.
We have a large number of jsp pages.
Our problem was fixed by setting the MaxPermSize  ( -XX:MaxPermSize=256m
).
We plan to retool our pages and make them html served by apache, with an
iframe to a single jsp page that will handle the dynamic content.
Take Care.
Shannon


-----Original Message-----
From: Shannon Scott [mailto:sscott@gwi.net] 
Sent: Thursday, September 23, 2004 11:20 AM
To: tomcat-user@jakarta.apache.org
Subject: Tomcat dies at 167M

Greetings,
Tomcat is running, and was working fine until the memory usage went up
to 167, now none of the .jsp pages will respond ( the server hangs
forever ).
The last entries from the Catalina.out are :
java.lang.OutOfMemoryError
java.lang.OutOfMemoryError
java.lang.OutOfMemoryError
 
I don't understand how the JVM could be our of memory because I set it
to use 256M.  
So the last time this happened, I wrote a piece of code that would leak
some memory thinking that might be somehow related, but the tomcat
process used more than 167M when I tested that page.
 
 
I have set the CATALINA_OPTS="-Xms64M -Xmx256M", and everything looks
right when I list the processes.
ps -elf | grep tomcat :
 
0 S tomcat4  17629     1  0  85   0    - 315671 schedu Sep21 ?
00:00:04 /usr/java/j2sdk1.4.2_03/bin/java -Xms64M -Xmx256M.
 
However, after the system shows 167M in top, tomcat no longer responds.
None of the tomcat logs are written to, and I find this in the mod_jk
log :
 
[Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (738)]: ERROR: can't
receive the response message from tomcat, network problems or tomcat is
down. err=-104
[Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1137)]: Error reading
reply from tomcat. Tomcat is down or network problems.
[Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1290)]: ERROR: Receiving
from tomcat failed, recoverable operation. err=0
[Thu Sep 23 11:00:03 2004]  [jk_ajp_common.c (1309)]: sending request to
tomcat failed in send loop. err=0
 
top output :
 
  PID    USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU
COMMAND
17629  tomcat4   25    0  167M 140M 12484 S     0.0  6.9  15:40   0 java
 
RedHat Linux ES 3.0
Apache 2.0.46 with ( mod_jk )
Tomcat 4.1.24
Sun j2sdk 1.4.2_03
 
I am confused.  Any help is greatly appreciated.  Please let me know if
I can provide any more informative details.  
Thank you for your time.
Take Care.
Shannon
 
PS
I have searched list archives and read the docs about tomcat
OutOfMemoryError, but none seem to address my problem.


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