Tomcat version: 9.0.62https://github.com/apache/tomcat/blob/9.0.62/java/org/apache/tomcat/util/threads/TaskQueue.java#L116 //if we have less threads than maximum force creation of a new thread if (parent.getPoolSize()<parent.getMaximumPoolSize()) { return false; }
we have set sever.tomcat.max-threads=300 for the embedded tomcat server in our app, but the number of http-nio-xxx-exec threads will be 500+ which will cause JVM free memory exhausted under pressure tesing.it seemed that all org.apache.tomcat.util.threads.TaskQueue#offer calling return false if more than 300 requests are accepted at the same time.