I'm using Spring Boot (1.3.O.M5) with Undertow. Recently, I've found that when I use the
lsof -p $(pidof java)
command after a few hours, it presents me with about 700 lines, most of which are established TCP connections to clients, even though almost nobody entered the page in the recent hour (and when I connect to the site, my connection is gone after about 5 minutes).
Most likely this is the source of my java.net.SocketException: Too many open files - which I got every couple of days (requiring me to restart the app) before I noticed the stale connections. I increased the max open files limit in the system, but it obviously seems a short-term solution.
I would appreciate help with the issue. Thanks!