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

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

commit 3783dc83065414cd85179e9a9014da44780e14b6
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Sep 24 17:50:43 2020 +0100

    Reduce memory footprint of closed http/2 streams
    
    This refactoring replaces closed streams with a new RecycledStream
    object and changes the mechanism used to look up known streams.
    Pull-up isClosedFinal()
---
 java/org/apache/coyote/http2/AbstractNonZeroStream.java | 1 +
 java/org/apache/coyote/http2/RecycledStream.java        | 8 ++++++++
 java/org/apache/coyote/http2/Stream.java                | 1 +
 3 files changed, 10 insertions(+)

diff --git a/java/org/apache/coyote/http2/AbstractNonZeroStream.java 
b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
index ce08cc5..70cfe35 100644
--- a/java/org/apache/coyote/http2/AbstractNonZeroStream.java
+++ b/java/org/apache/coyote/http2/AbstractNonZeroStream.java
@@ -97,4 +97,5 @@ abstract class AbstractNonZeroStream extends AbstractStream {
         this.weight = weight;
     }
 
+    abstract boolean isClosedFinal();
 }
diff --git a/java/org/apache/coyote/http2/RecycledStream.java 
b/java/org/apache/coyote/http2/RecycledStream.java
index 1e630df..dbbdc10 100644
--- a/java/org/apache/coyote/http2/RecycledStream.java
+++ b/java/org/apache/coyote/http2/RecycledStream.java
@@ -23,10 +23,12 @@ package org.apache.coyote.http2;
 class RecycledStream extends AbstractNonZeroStream {
 
     private final String connectionId;
+    private final boolean closedFinal;
 
     RecycledStream(Stream stream) {
         super(stream.getIdentifier(), stream.getWeight());
         connectionId = stream.getConnectionId();
+        closedFinal = stream.isClosedFinal();
     }
 
 
@@ -34,4 +36,10 @@ class RecycledStream extends AbstractNonZeroStream {
     String getConnectionId() {
         return connectionId;
     }
+
+
+    @Override
+    boolean isClosedFinal() {
+        return closedFinal;
+    }
 }
diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index ef7ed29..489ce53 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -646,6 +646,7 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
     }
 
 
+    @Override
     final boolean isClosedFinal() {
         return state.isClosedFinal();
     }


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

Reply via email to