• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Too many open files

 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • 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).
 
Duc Vo
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic