The application i am working on suddenly crashed with
java.io.IOException: ... Too many open files
As i understand the issue it means that files are opened but not closed.
Stacktrace of course happens after the fact and can only help understand before what event error occurred.
What would be an intelligent way to search your code base to find this issue which only seems to occur when app is under high stress load.
use lsof -p pid
to check what cause leak of file references;
use ulimit -n
to see the limit of opened file references of a single process;
check any IO resources in your project,are they released in time?,Note that,File
,Process
,Socket
(and Http connections) are all IO resources.
sometimes, too many threads will cause this problem too.