I am working on a Spring Boot application with Angular as front end APP which is giving this java.net.SocketException: Too many open files exception during API calls. The application is running on Suse Linux 15. I am aware that OS maintains a file descriptor for each socket that is opened by the process. OS also does the same for any file, bufferedreader or inputstream that the Java process is opening. In code all the inputstreams are getting close but still the lsof is shows large number of files opened by this process.
Exception: java.net.SocketException: Too many open files Also checked below command, the output is showing lot of files from Angular lib. Is there any relateion to Angular?
Tried command: ls -l /proc/TOMCAT_PROCESS_ID/fd
lr-x------ 1 root root 64 Feb 8 08:16 100 -> /opt/poly/angular/app/app-boot/lib/redstone-1.1.1.jar
l-wx------ 1 root root 64 Feb 8 08:16 1000 -> pipe:[44088631]
lrwx------ 1 root root 64 Feb 8 08:16 1001 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Feb 8 08:16 1002 -> pipe:[43910846]
lr-x------ 1 root root 64 Feb 8 08:16 1003 -> pipe:[43910751]
l-wx------ 1 root root 64 Feb 8 08:16 1004 -> pipe:[43910751]
lrwx------ 1 root root 64 Feb 8 08:16 1005 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Feb 8 08:16 1006 -> pipe:[43910752]
l-wx------ 1 root root 64 Feb 8 08:16 1007 -> pipe:[43910752]
lrwx------ 1 root root 64 Feb 8 08:16 1008 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Feb 8 08:16 1009 -> pipe:[43910753]
lr-x------ 1 root root 64 Feb 8 08:16 101 -> /opt/poly/angular/app/app-boot/lib/quartz-2.3.0.jar
l-wx------ 1 root root 64 Feb 8 08:16 1010 -> pipe:[43910753]
lrwx------ 1 root root 64 Feb 8 08:16 1011 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Feb 8 08:16 1012 -> pipe:[43910754]
l-wx------ 1 root root 64 Feb 8 08:16 1013 -> pipe:[43910754]
l-wx------ 1 root root 64 Feb 8 08:16 1014 -> pipe:[43910846]
lrwx------ 1 root root 64 Feb 8 08:16 1015 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Feb 8 08:16 1016 -> pipe:[44088306]
l-wx------ 1 root root 64 Feb 8 08:16 1017 -> pipe:[44088306]
lrwx------ 1 root root 64 Feb 8 08:16 1018 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Feb 8 08:16 1019 -> pipe:[44088307]