We are observing a steady build up of I/O dispatcher threads when firing queries from a Tomcat webapp we've developed. One thing to note... we are using the low-level Java REST client, and we only call close() on the RestClient when the webapp is stopped during Tomcat shutdown (i.e. ServletContextListener)... does this mean that the I/O dispatcher threads are only released then? Is there another way to release these threads? The problem is that they end up consuming a lot of memory and eventually the Tomcat instance goes OutOfMemory. Is there some basic step we could be missing here to ensure proper cleanup?
Also want to point out that our requests are returning with HTTP code 200, so we don't think it has anything to do with connections not getting cleaned up on failure.