filehandler - java open files not cleaned, even when the process is killed -


there java program read files folder, processing , write output files in folder. ran 4 hours , produced few files failed after throwing following error:

"too many files" 

then modified program close (bufferreader , bufferwriter) , started process again. time process failed after starting throwing following error:

java.io.filenotfoundexception: <file> (too many open files) 

then tried running lsof , searched process having no of open files. realized networkmanager. not sure whether should kill process or not. restarted machine. after when ran java program, still got same error.

in worst case might possible code still having leaks in terms of not closing everything, still failing after starting process. have feeling lying in system previous run. if start same process in other machine, runs hours before failing.

you cannot retain resource between runs of program, if wanted to. leave system without enough resources in theory, though unlikely, restarting machine should fix that.

what more files have enough trigger program run out of file handles. try renaming directory store files in , starting empty 1 confirm this.


Comments

  1. Hi Admin,

    The article is very informative and regarding javascript.

    Regards,

    Dentist In Chicopee

    ReplyDelete

Post a Comment

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -