The hunt for "too many files"

We encountered some strange problem on one of the client servers where Java encounters "Too many files",

Checking the descriptors via lsof gives a large list of descriptors "sock" with "unable to determine the protocol."

I suspect this is due to sockets that opened too much time, but since there are a lot of them in our stream dump, I don’t know who the culprit is.

Is there any good way to determine which streams open these sockets exactly?

Thank.

+3
source share
5 answers

Is there any good way to determine which streams open these sockets exactly?

Not the threads themselves.

- . , . (@SyBer , YourKit ... . .)

ulimit . " " .

, "grepping" , , . , , try/finally, , .

+2

netstat -ano | grep $YOUR_PROCESS_ID - unix

netstat -ano | find "$YOUR_PROCESS_ID" -

, , .

+2

ulimit ? , , , .

+1

"" , . .

0

Valgrind , --track-fds=yes. Valgrind "" , . , , pthread_self (I ' m sure, !) gdb.

, close() , . , .

0

Source: https://habr.com/ru/post/1775170/


All Articles