You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Morahg, Yoav" <ym...@gist.com> on 2000/08/09 21:21:03 UTC

FW: JDK memory options

I previously asked the questions below. I have not gotten an answer to my
main question, but I wonder if someone could tell me how to make sure that
the JVM is picking up the min/max memory options I set in tomcat.properties.
I suspect my error is due to running out of memory, but I can't be sure and
I don't know if I've actually upped the JVM's memory or not.
 
Thanks in advance,
-Yoav
 
-----Original Message-----
From: Morahg, Yoav [mailto:ymorahg@gist.com]
Sent: Wednesday, August 09, 2000 1:50 PM
To: 'tomcat-user@jakarta.apache.org'
Subject: FW: Handler Thread Problem


Sorry, I didn't copy the whole exception that shows up in the tomcat.log...
it is corrected below.
 
-Y 

Context log: path="/iwon" Broken pipe /iwon/channelserver.jsp
Context log: path="/iwon" Error in jsp service() : Broken pipe
 javax.servlet.ServletException: Broken pipe
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at javax.servlet.ServletException.<init>(ServletException.java:161)
        at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled
Code)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:55\
9)
        at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processCo\
nnection(Compiled Code)
        at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)
Context log: path="/iwon" <b>Internal Servlet Error:</b><br>
<pre>
javax.servlet.ServletException: Broken pipe
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at javax.servlet.ServletException.<init>(ServletException.java:161)
        at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled
Code)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:55\
9)
        at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processCo\
nnection(Compiled Code)
         at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)
</pre>
<b>Root cause:</b>
<pre>
java.io.IOException: Broken pipe
        at java.net.SocketOutputStream.socketWrite(Native Method)
        at java.net.SocketOutputStream.socketWrite(Compiled Code)
        at java.net.SocketOutputStream.write(Compiled Code)
        at
org.apache.tomcat.service.http.HttpResponseAdapter.endHeaders(Compil\
ed Code)
        at
org.apache.tomcat.core.BufferedServletOutputStream.sendHeaders(Buffe\
redServletOutputStream.java:127)
        at
org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush(Compi\
led Code)
        at
org.apache.tomcat.core.ResponseImpl.flushBuffer(ResponseImpl.java:33\
0)
        at
org.apache.tomcat.core.HttpServletResponseFacade.flushBuffer(HttpSer\
vletResponseFacade.java:235)
        at
org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:195\
)
        at
_0002fchannelserver_0002ejspchannelserver_jsp_34._jspService(Compile\
d Code)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspSe\
rvlet.java:174)
        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:\
261)
        at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled
Code)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:55\
9)
        at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processCo\
nnection(Compiled Code)
        at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)
</pre>

Does this mean my db connection is breaking? This seems odd because I always
return from the db call and successfully check that there is data in the
result set.
 
Any help appreciated!
 
-Yoav


-----Original Message-----
From: Morahg, Yoav 
Sent: Wednesday, August 09, 2000 1:29 PM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: Handler Thread Problem


That's just it, I can't track down where this is happening because I get to
different points in my .jsp page every time I run it. One thing to note is
that I'm reading a large result set from the db (3200+ rows with 32 columns
each). It seems to be coming back from there alright (I have code that tells
me whether data came back from the db or not) but maybe I'm overloading
something with all this data in memory?
 
-Y
 

--------------------------- 
Yoav Morahg 
Software Engineer 
Gist Communications 
(212) 965-1999 xt 122 
ymorahg@gist.com 

-----Original Message-----
From: Boniakowski,Jeb [mailto:JBoniakowski@nntllc.com]
Sent: Wednesday, August 09, 2000 1:22 PM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: Handler Thread Problem



What is the code that causes this? 

jeb. 

> -----Original Message----- 
> From: Morahg, Yoav [ mailto:ymorahg@gist.com <ma...@gist.com> ] 
> Sent: Wednesday, August 09, 2000 1:21 PM 
> To: 'tomcat-user@jakarta.apache.org' 
> Subject: Handler Thread Problem 
> 
> 
> Hi. 
> 
> I am getting the exception below with Tomcat 3.1 (w/Apache 1.3.12 and 
> Solaris 8). I believe this has something to do with writing 
> out data since 
> it comes from 
> org.apache.tomcat.core.BufferedServletOutputStream but I'm not 
> sure. I thought I might be sending too much data to the out 
> stream, but I 
> commented out the code the outputs to the page and I still 
> get this message. 
> Does anyone know what this means??? 
> 
> Also, I thought I might be running out of memory, so I set 
> the properties: 
> 
>       wrapper.bin.parameters=-Xms=128 
>       wrapper.bin.parameters=-Xmx=256 
> 
> in my tomcat.properties file. Does anyone know how I can find 
> out if these 
> options actually worked? 
> 
> Thanks so much, 
> -Yoav 
> 
> 
> 
> HANDLER THREAD PROBLEM: java.lang.NullPointerException 
> java.lang.NullPointerException 
>         at 
> org.apache.tomcat.service.connector.AJP12ResponseAdapter.sendS 
> tatus(Compiled 
> Code) 
>         at 
> org.apache.tomcat.service.http.HttpResponseAdapter.endHeaders( 
> Compiled Code) 
>         at 
> org.apache.tomcat.core.BufferedServletOutputStream.sendHeaders 
> (BufferedServl 
> etOutputStream.java:127) 
>         at 
> org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush 
> (Compiled 
> Code) 
>         at 
> org.apache.tomcat.core.BufferedServletOutputStream.close(Buffe 
redServletOutp 
> utStream.java:258) 
>         at 
> java.io.OutputStreamWriter.close(OutputStreamWriter.java:252) 
>         at java.io.PrintWriter.close(PrintWriter.java:138) 
>         at 
> org.apache.tomcat.core.ResponseImpl.finish(ResponseImpl.java:176) 
>         at 
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.pro 
> cessConnection 
> (Ajp12ConnectionHandler.java:158) 
>         at 
> org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEnd 
point.java:338 
> ) 
>         at java.lang.Thread.run(Thread.java:485) 
> 
> --------------------------- 
> Yoav Morahg 
> Software Engineer 
> Gist Communications 
> (212) 965-1999 xt 122 
> ymorahg@gist.com 
> 


Re: FW: JDK memory options

Posted by Tim Kientzle <ki...@acm.org>.
Within your application, print the
values of

Runtime.getRuntime().totalMemory()

and 

Runtime.getRuntime().freeMemory()

Note that -Xmax is exactly what it sounds like: a maximum limit
on the heap size.  The heap will grow until it hits that limit.

I've found the JVM to be quite up-front about memory problems.
If it runs out of memory, it will generally tell you.

If you're on Unix, 'ps' is a wonderful tool as well.

			- Tim

> I previously asked the questions below. I have not gotten an answer to my main question, but I wonder if
> someone could tell me how to make sure that the JVM is picking up the min/max memory options I set in
> tomcat.properties. I suspect my error is due to running out of memory, but I can't be sure and I don't know
> if I've actually upped the JVM's memory or not.
>  
> Thanks in advance,
> -Yoav
>

Re: FW: JDK memory options

Posted by Joe Wielgosz <jo...@cola.iges.org>.
Calling Runtime.getRuntime().totalMemory() in your init method,  and 
printing the result will at least tell you if it picked up the minimum 
setting...

At 03:21 PM 8/9/00, you wrote:
>I previously asked the questions below. I have not gotten an answer to my 
>main question, but I wonder if someone could tell me how to make sure that 
>the JVM is picking up the min/max memory options I set in 
>tomcat.properties. I suspect my error is due to running out of memory, but 
>I can't be sure and I don't know if I've actually upped the JVM's memory 
>or not.
>
>Thanks in advance,
>-Yoav
>
>-----Original Message-----
>From: Morahg, Yoav [mailto:ymorahg@gist.com]
>Sent: Wednesday, August 09, 2000 1:50 PM
>To: 'tomcat-user@jakarta.apache.org'
>Subject: FW: Handler Thread Problem
>
>Sorry, I didn't copy the whole exception that shows up in the 
>tomcat.log... it is corrected below.
>
>-Y
>Context log: path="/iwon" Broken pipe /iwon/channelserver.jsp
>Context log: path="/iwon" Error in jsp service() : Broken pipe
>  javax.servlet.ServletException: Broken pipe
>         at java.lang.Throwable.fillInStackTrace(Native Method)
>         at java.lang.Throwable.fillInStackTrace(Compiled Code)
>         at java.lang.Throwable.<init>(Compiled Code)
>         at java.lang.Exception.<init>(Compiled Code)
>         at javax.servlet.ServletException.<init>(ServletException.java:161)
>         at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
>         at 
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:55\
>9)
>         at 
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processCo\
>nnection(Compiled Code)
>         at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
>         at java.lang.Thread.run(Compiled Code)
>Context log: path="/iwon" <b>Internal Servlet Error:</b><br>
><pre>
>javax.servlet.ServletException: Broken pipe
>         at java.lang.Throwable.fillInStackTrace(Native Method)
>         at java.lang.Throwable.fillInStackTrace(Compiled Code)
>         at java.lang.Throwable.<init>(Compiled Code)
>         at java.lang.Exception.<init>(Compiled Code)
>         at javax.servlet.ServletException.<init>(ServletException.java:161)
>         at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
>         at 
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:55\
>9)
>         at 
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processCo\
>nnection(Compiled Code)
>          at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
>         at java.lang.Thread.run(Compiled Code)
></pre>
><b>Root cause:</b>
><pre>
>java.io.IOException: Broken pipe
>         at java.net.SocketOutputStream.socketWrite(Native Method)
>         at java.net.SocketOutputStream.socketWrite(Compiled Code)
>         at java.net.SocketOutputStream.write(Compiled Code)
>         at 
> org.apache.tomcat.service.http.HttpResponseAdapter.endHeaders(Compil\
>ed Code)
>         at 
> org.apache.tomcat.core.BufferedServletOutputStream.sendHeaders(Buffe\
>redServletOutputStream.java:127)
>         at 
> org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush(Compi\
>led Code)
>         at 
> org.apache.tomcat.core.ResponseImpl.flushBuffer(ResponseImpl.java:33\
>0)
>         at 
> org.apache.tomcat.core.HttpServletResponseFacade.flushBuffer(HttpSer\
>vletResponseFacade.java:235)
>         at 
> org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:195\
>)
>         at 
> _0002fchannelserver_0002ejspchannelserver_jsp_34._jspService(Compile\
>d Code)
>         at 
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at 
> org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspSe\
>rvlet.java:174)
>         at 
> org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:\
>261)
>         at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
>         at 
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:55\
>9)
>         at 
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processCo\
>nnection(Compiled Code)
>         at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
>         at java.lang.Thread.run(Compiled Code)
></pre>
>
>Does this mean my db connection is breaking? This seems odd because I 
>always return from the db call and successfully check that there is data 
>in the result set.
>
>Any help appreciated!
>
>-Yoav
>
>-----Original Message-----
>From: Morahg, Yoav
>Sent: Wednesday, August 09, 2000 1:29 PM
>To: 'tomcat-user@jakarta.apache.org'
>Subject: RE: Handler Thread Problem
>
>That's just it, I can't track down where this is happening because I get 
>to different points in my .jsp page every time I run it. One thing to note 
>is that I'm reading a large result set from the db (3200+ rows with 32 
>columns each). It seems to be coming back from there alright (I have code 
>that tells me whether data came back from the db or not) but maybe I'm 
>overloading something with all this data in memory?
>
>-Y
>
>
>---------------------------
>Yoav Morahg
>Software Engineer
>Gist Communications
>(212) 965-1999 xt 122
>ymorahg@gist.com
>-----Original Message-----
>From: Boniakowski,Jeb [mailto:JBoniakowski@nntllc.com]
>Sent: Wednesday, August 09, 2000 1:22 PM
>To: 'tomcat-user@jakarta.apache.org'
>Subject: RE: Handler Thread Problem
>
>What is the code that causes this?
>
>jeb.
>
> > -----Original Message-----
> > From: Morahg, Yoav [<ma...@gist.com>mailto:ymorahg@gist.com]
> > Sent: Wednesday, August 09, 2000 1:21 PM
> > To: 'tomcat-user@jakarta.apache.org'
> > Subject: Handler Thread Problem
> >
> >
> > Hi.
> >
> > I am getting the exception below with Tomcat 3.1 (w/Apache 1.3.12 and
> > Solaris 8). I believe this has something to do with writing
> > out data since
> > it comes from
> > org.apache.tomcat.core.BufferedServletOutputStream but I'm not
> > sure. I thought I might be sending too much data to the out
> > stream, but I
> > commented out the code the outputs to the page and I still
> > get this message.
> > Does anyone know what this means???
> >
> > Also, I thought I might be running out of memory, so I set
> > the properties:
> >
> >       wrapper.bin.parameters=-Xms=128
> >       wrapper.bin.parameters=-Xmx=256
> >
> > in my tomcat.properties file. Does anyone know how I can find
> > out if these
> > options actually worked?
> >
> > Thanks so much,
> > -Yoav
> >
> >
> >
> > HANDLER THREAD PROBLEM: java.lang.NullPointerException
> > java.lang.NullPointerException
> >         at
> > org.apache.tomcat.service.connector.AJP12ResponseAdapter.sendS
> > tatus(Compiled
> > Code)
> >         at
> > org.apache.tomcat.service.http.HttpResponseAdapter.endHeaders(
> > Compiled Code)
> >         at
> > org.apache.tomcat.core.BufferedServletOutputStream.sendHeaders
> > (BufferedServl
> > etOutputStream.java:127)
> >         at
> > org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush
> > (Compiled
> > Code)
> >         at
> > org.apache.tomcat.core.BufferedServletOutputStream.close(Buffe
>redServletOutp
> > utStream.java:258)
> >         at
> > java.io.OutputStreamWriter.close(OutputStreamWriter.java:252)
> >         at java.io.PrintWriter.close(PrintWriter.java:138)
> >         at
> > org.apache.tomcat.core.ResponseImpl.finish(ResponseImpl.java:176)
> >         at
> > org.apache.tomcat.service.connector.Ajp12ConnectionHandler.pro
> > cessConnection
> > (Ajp12ConnectionHandler.java:158)
> >         at
> > org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEnd
>point.java:338
> > )
> >         at java.lang.Thread.run(Thread.java:485)
> >
> > ---------------------------
> > Yoav Morahg
> > Software Engineer
> > Gist Communications
> > (212) 965-1999 xt 122
> > ymorahg@gist.com
> >


joe wielgosz
software engineer - institute for global environment and society
joew@cola.iges.org / 301-902-1278 / 301-595-9793 fax