You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I kept getting a "too many files open" exception in my program which processes a large number of files and scans a large number of directories. After investigating I found out that my number of file descriptors kept forever increasing. The problem is with the way I listed directories, namely:
I am not sure this is a bug, one could say I was not using the library the right way, but I'll let you decide.
The text was updated successfully, but these errors were encountered:
bchazalet
changed the title
dir.list.filter().toList does not close the directory file descriptor
dir.list.filter().toList does not close the directory file descriptor
Dec 13, 2018
I kept getting a "too many files open" exception in my program which processes a large number of files and scans a large number of directories. After investigating I found out that my number of file descriptors kept forever increasing. The problem is with the way I listed directories, namely:
Doing so, the
jsonDir
file descriptor is kept open forever. I uselsof -p <pid> | egrep 'DIR|REG'
to see the open file descriptors for my process.I found that doing this solves my problem:
I am not sure this is a bug, one could say I was not using the library the right way, but I'll let you decide.
The text was updated successfully, but these errors were encountered: