• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.io.Exception , Broken pipe

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Servlets Gurus!

I developed an application, it's a servlet that receives files and process
according to bussiness rules, the problem is that in Java Application Server Logs, there are messages like this:

java.io.Exception : Broken pipe or Connection reset by peer and
it's on logs lot of times, i know the problem is due to servlet doesn't find
where to write the response, (maybe users hit on refresh, close the browser or something like this)

According to Servers administrator, this sessions aren't destroyed and are present on the JAS and consumes resources on CPU or others, IS IT POSSIBLE???

so from time to time Administrator has to restart the JAS to free those resources, and so the application has a good performance...


if this sessions represent a problem, what can i do to solve it?, do i have to do something in code? or on JAS aministration console?

Please any help or hint will be apreciated...


Thanks!
Csar.
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cesar - any application that maintains session on the servers will chew up resources even after the user has left (e.g., closed browser window). You can set the timeout for such sessions in your application server. Once you do that, these sessions don't hold onto resources forever.

Another thing to consider is the size of data in your sessions. Try to keep session objects small so that memory requirement for the same number of concurrent users is smaller.
[ May 27, 2005: Message edited by: Sharad Agarwal ]
 
Cesar Tg.
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sharad!

I wasn't refering to Sesions on data, In fact i am not using sessions, i meant it seems that TCP/IP connections are maintained by the JAS when the servlet doesn't find where to write the response(maybe user close the browser).. and because of this
the messages java.io.Exception broken pipe... are on logs

does it cause the Server CPU is always in 100%? (this open connections..)

and if so, what can i do to solve it?


Thanks
Csar
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An application developer shouldn't really be too concerned with this.
It is really the duty of the people developing the container (tomcat or jas) to handle situations like this.

An end user breaking the connection by closing their browser going to another URL will cause this.

Does your sysadmin have any proof that the container isn't cleaning up after these broken connections or is s/he just disturbed by the log entries?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i know the problem is due to servlet doesn't find
where to write the response, (maybe users hit on refresh, close the browser or something like this)



Another thought: Is it possible that these aren't connections broken by the user? Could they be timed out database connections that are still being maintained in your connection pool because the methods that use them aren't properly closing them?

That, is something that would cause a memory leak which can only be cleaned up by rebooting the app server.
[ May 27, 2005: Message edited by: Ben Souther ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic