*
The moose likes JBoss/WildFly and the fly likes Too many open files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Too many open files" Watch "Too many open files" New topic
Author

Too many open files

Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

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).

My Blog: Down Home Country Coding with Scott Selikoff
Duc Vo
Ranch Hand

Joined: Nov 20, 2008
Posts: 254
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.


“Everything should be as simple as it is, but not simpler.” Albert Einstein
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

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

Joined: Nov 20, 2008
Posts: 254
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Too many open files