• 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

Too many open files

 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was doing some load testing on my server and all at once the processes start dying with the message:

Anyone familiar with this issue and how to resolve it? I was accessing the files via iText library, so I don't have direct access to close the connections (as far as I know).
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Scott Selikoff wrote:I was doing some load testing on my server and all at once the processes start dying with the message:

Anyone familiar with this issue and how to resolve it? I was accessing the files via iText library, so I don't have direct access to close the connections (as far as I know).


Do you know which code opens and reads the file? It doesn't seem to close the file properly after read.
 
Scott Selikoff
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought of that but I don't really have access to the streams. For example, two of the files are loaded via iText methods into objects that don't seem to have an equivalent close() method:

http://1t3xt.info/api/com/lowagie/text/Image.html#getInstance(java.lang.String)
http://1t3xt.info/api/com/lowagie/text/pdf/BaseFont.html#createFont(java.lang.String,%20java.lang.String,%20boolean)

I can try reorganizing the code into more reusable objects, but thats avoiding the issue, not really solving it.
 
Duc Vo
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure what server technology that you are using. But I think to work around you can use singleton to create and cache the image instance then use
getInstance(com.lowagie.text.Image) to create different object instances to avoid IO overheads. It should work.
Hope it help,

Duc
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic