The number of file handles opened by the java process is abnormal

recently found something abnormal in the program. Take a look at the number of handles opened

[root@dev-test-server ~]-sharp lsof -n|awk "{print $2}"|sort|uniq -c|sort -nr|head -10
 152158 7076
  21344 11305
   2338 30006
   2096 938
....

my java process ID is 7076, and you can see 15W file handles opened
but I looked at the value set by the system


[root@dev-test-server ~]-sharp cat /proc/sys/fs/file-max 
587860

[root@dev-test-server ~]-sharp ulimit -n
1024

you can see that the handle opened by a single process obviously exceeds the limit.
I don"t know where I misunderstood it. Now I am very confused. Is there a great god to explain it

?
Mar.23,2021

you should use lsof-n-p < pid > to view the open file of the process, and cat / proc/ < pid > / limits to view the limit number.

Menu