Fix open too many file exception.