This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit d88e0840c0278ed72fb14d9bf65b67097fe5a0bb
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jun 25 11:57:58 2020 +0100

    Add the plumbing to 'recycle' an HTTP/2 Stream
---
 java/org/apache/coyote/http2/Stream.java          | 13 +++++++++++++
 java/org/apache/coyote/http2/StreamProcessor.java |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 32de3fe..5f28617 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -681,6 +681,19 @@ public class Stream extends AbstractStream implements 
HeaderEmitter {
         if (inputBuffer != null) {
             inputBuffer.receiveReset();
         }
+        recycle();
+    }
+
+
+    /*
+     * This method is called recycle for consistency with the rest of the 
Tomcat
+     * code base. Currently, it only sets references to null for the purposes 
of
+     * reducing memory footprint. It does not fully recycle the Stream ready 
for
+     * re-use since Stream objects are not re-used.
+     */
+    final void recycle() {
+        // Currently a NO-OP. This will change shortly to address the TODO for
+        // nulling out references.
     }
 
 
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java 
b/java/org/apache/coyote/http2/StreamProcessor.java
index 0106cf4..5a24f44 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -86,6 +86,9 @@ class StreamProcessor extends AbstractProcessor {
                                         stream.getIdAsInt());
                             }
                             stream.close(se);
+                        } else {
+                            // stream.close() will call recycle so only need 
it here
+                            stream.recycle();
                         }
                     }
                 } catch (Exception e) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to