I found it when debugging my java web project,cause wanna trace the HttpResponse obejct. to find where and when it's initialized. Since tomcat don 't clear InputStream/OutputStream when recycling the Request/Response in Http11NioProcessor ,so i couldn't figure it out.
There are related codes : In class org.apache.catalina.connector.Request if (Globals.IS_SECURITY_ENABLED || Connector.RECYCLE_FACADES) { if (facade != null) { facade.clear(); facade = null; } if (inputStream != null) { inputStream.clear(); inputStream = null; } if (reader != null) { reader.clear(); reader = null; } } and in class org.apache.catalina.connector.Connector /** * Alternate flag to enable recycling of facades. */ public static final boolean RECYCLE_FACADES = Boolean.parseBoolean(System.getProperty("org.apache.catalina.connector.RECYCLE_FACADES", "false")); Whether this design for better performance or other essential reasons? I don't have much knowledge about tomcat, so any help will be appreciated.