Re: Tomcat memory issues

2007-09-11 Thread Morten

Peter Warren [EMAIL PROTECTED] skrev i en meddelelse 
news:[EMAIL PROTECTED]
 As far as I under stand I should NOT close the stream object as I 
 didn't
 open it.

 That's my understanding too.  When I said I was keeping connections
 open, I meant I was opening connections from the client and not
 closing them.  Since I'm using comet servlets, the server keeps the
 connections open until the client disconnects.  When I open many
 connections, I see classes in my heap similar to those you show.

 If you keep a reference to the Request object tucked away somewhere on
 the server inadvertently, the associated buffers won't go away and
 memory will continue to grow.  Is it possible that you're keeping a
 reference to the Request or any of the streams somewhere?  Is it
 possible that some of your servlets aren't returning and thus never
 closing their connections?

ACCA is referenced by ACC.
ACCB is referenced by a org.apache.coyote.Response.
ACCC is referenced by a class[] which again is referenced by a
org.apache.coyote.Request. That object is referenced by:
org.apache.coyote.http11.Http11Processor,
org.apache.coyote.http11.InternalInputBuffer
org.apache.coyote.Response
org.apache.catalina.connector.Request
org.apache.catalina.connector.InputBuffer
org.apache.coyote.RequestInfo.

Best regards and thanks for your response,
Morten




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



Re: Tomcat memory issues

2007-09-07 Thread Morten

Peter Warren [EMAIL PROTECTED] skrev i en meddelelse 
news:[EMAIL PROTECTED]
 Is it possible you're caching Request or Response objects somewhere
 and not releasing them?  I just did a bunch of memory profiling and
 many of the classes you mention are the same classes I see when I open
 and don't close a bunch of connections to the server.

My code in the bottom of the servlet is such:

ServletOutputStream stream = _response.getOutputStream();
BufferedOutputStream bos = new BufferedOutputStream(stream);
bos.write(bytes);
stream.flush();
bos.close();

As far as I under stand I should NOT close the stream object as I didn't 
open it.

Best regards,

Morten






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



Re: Tomcat memory issues

2007-09-07 Thread Peter Warren
 As far as I under stand I should NOT close the stream object as I didn't
 open it.

That's my understanding too.  When I said I was keeping connections
open, I meant I was opening connections from the client and not
closing them.  Since I'm using comet servlets, the server keeps the
connections open until the client disconnects.  When I open many
connections, I see classes in my heap similar to those you show.

If you keep a reference to the Request object tucked away somewhere on
the server inadvertently, the associated buffers won't go away and
memory will continue to grow.  Is it possible that you're keeping a
reference to the Request or any of the streams somewhere?  Is it
possible that some of your servlets aren't returning and thus never
closing their connections?

What classes are holding references to these classes?

- org.apache.catalina.connector.ResponseFacade (ACCA)
- class[] (ACCB)
- org.apache.catalina.connector.Request (ACCC)

Peter

On 9/7/07, Morten [EMAIL PROTECTED] wrote:

 Peter Warren [EMAIL PROTECTED] skrev i en meddelelse
 news:[EMAIL PROTECTED]
  Is it possible you're caching Request or Response objects somewhere
  and not releasing them?  I just did a bunch of memory profiling and
  many of the classes you mention are the same classes I see when I open
  and don't close a bunch of connections to the server.
 
 My code in the bottom of the servlet is such:

 ServletOutputStream stream = _response.getOutputStream();
 BufferedOutputStream bos = new BufferedOutputStream(stream);
 bos.write(bytes);
 stream.flush();
 bos.close();

 As far as I under stand I should NOT close the stream object as I didn't
 open it.

 Best regards,

 Morten






 -
 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]



RE: Tomcat memory issues

2007-09-06 Thread Caldarale, Charles R
 From: news [mailto:[EMAIL PROTECTED] On Behalf Of Morten
 Subject: Tomcat memory issues
 
 Are there any way to stop Tomcat from cached these large 
 byte[] internally?

If you look near the end of conf/catalina.properties, you'll see some
caching enable/disable lines; you might try turning off the one for byte
and see what happens.  I haven't tried this, so I don't really know if
it will help or what effect it will have on performance or any other
operational characteristic.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



Re: Tomcat memory issues

2007-09-06 Thread Dwayne
If you don't want to cache internally then you need a distributed caching
scheme.
There is an open source solution from the guys at Terracotta.org they call
Network Attached Memory.  Basically you can deploy a virtual heap against
disk and make your memory as big as you want.  They built all sorts of drop
in config modules already:
https://wiki.terracotta.org/confluence/display/integrations/Home.

Hope this helps.

Dwayne
Go Open Source


On 9/6/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: news [mailto:[EMAIL PROTECTED] On Behalf Of Morten
  Subject: Tomcat memory issues
 
  Are there any way to stop Tomcat from cached these large
  byte[] internally?

 If you look near the end of conf/catalina.properties, you'll see some
 caching enable/disable lines; you might try turning off the one for byte
 and see what happens.  I haven't tried this, so I don't really know if
 it will help or what effect it will have on performance or any other
 operational characteristic.

 - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.

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




Re: Tomcat memory issues

2007-09-06 Thread Peter Warren
Is it possible you're caching Request or Response objects somewhere
and not releasing them?  I just did a bunch of memory profiling and
many of the classes you mention are the same classes I see when I open
and don't close a bunch of connections to the server.

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