• 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 - together with ProcessBuilder

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm going to process a bunch of files (few thousands) and I call external tools for that.
The places where I open a file for reading or writing, I use close in the finally section.

I also use close on the InputReader, I use for getting the output from the called tool.

How can I find out, what breaks my code?
Do I need to call gc or something else?

Are there side-effects of the ProcessBuilder, that I did not cared about?

Any hint is appreciated.

kind regards
Reinhard
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are exec()ing the "external tools" then it may be that you are not consuming the stdErr output of the Process.

As I understand it, a stdErr output stream is always created - perhaps that is showing up as an open file?

In any case, carefully read the java.lang.Process JavaDocs.

Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic